home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / unix / uucp106d / part02 < prev    next >
Encoding:
Internet Message Format  |  1990-06-28  |  66.2 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i180: UUCP 1.06D - UNIX compatible uucp/news/mail system, Part02/12
  5. Message-ID: <12971@xanth.cs.odu.edu>
  6. Date: 28 Jun 90 12:22:09 GMT
  7. Sender: news@cs.odu.edu
  8. Reply-To: Matt Dillon <@uunet.uu.net:overload!dillon>
  9. Lines: 2549
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: Matt Dillon <@uunet.uu.net:overload!dillon>
  15. Posting-number: Volume 90, Issue 180
  16. Archive-name: unix/uucp-1.06d/part02
  17.  
  18. #!/bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 2 (of 12)."
  25. # Contents:  uucp2/src/README uucp2/src/anews/sendpacket.c
  26. #   uucp2/src/dmail/DMakefile uucp2/src/dmail/DMakefile.dcc
  27. #   uucp2/src/dmail/cond.c uucp2/src/dmail/dmkhelp.c
  28. #   uucp2/src/dmail/globals.c uucp2/src/getty/passwd.c
  29. #   uucp2/src/include/dnews_protos.h uucp2/src/include/ndir.h
  30. #   uucp2/src/include/news.h uucp2/src/lib/DMakefile
  31. #   uucp2/src/lib/DMakefile.dcc uucp2/src/lib/getfiles.c
  32. #   uucp2/src/lib/getpwnam.c uucp2/src/lib/log.c
  33. #   uucp2/src/sendmail/parse.c uucp2/src/unix/DMakefile
  34. #   uucp2/src/unix/DMakefile.dcc uucp2/src/unix/uuencode.c
  35. #   uucp2/src/util/man.c uucp2/src/util/trimfile.c
  36. #   uucp2/src/util/trimnews.c uucp2/src/uucico/DMakefile
  37. #   uucp2/src/uucico/DMakefile.dcc uucp2/src/uucico/gio.notes
  38. #   uucp2/src/uucico/sysdep.h uucp2/src/uucico/time.c
  39. #   uucp2/src/uucico/uucp.h uucp2/src/uucico/uupoll.c
  40. #   uucp2/src/uuser/misc.c
  41. # Wrapped by tadguy@xanth on Thu Jun 28 08:21:14 1990
  42. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  43. if test -f 'uucp2/src/README' -a "${1}" != "-c" ; then 
  44.   echo shar: Will not clobber existing file \"'uucp2/src/README'\"
  45. else
  46. echo shar: Extracting \"'uucp2/src/README'\" \(1374 characters\)
  47. sed "s/^X//" >'uucp2/src/README' <<'END_OF_FILE'
  48. X
  49. X    To compile:
  50. X
  51. X    * You must have Lattice C 5.02 or greater (you might have to get rid
  52. X      of the -cq option if you have <5.03.99),    OR
  53. X
  54. X    * If you have DICE, all files will compile under DICE.  DNews, in fact,
  55. X      currently only has a DMakefile for DICE.
  56. X
  57. X    * Does not compile under Aztec yet.
  58. X
  59. X    * The dmake executable is required (should be in UUCP:C)
  60. X
  61. X    * Object directories:  (I normally put these on a different
  62. X      partition on my HD).  Holds .O files and symbol table.
  63. X
  64. X            (Lattice)
  65. X
  66. X    Assign LTMP: <some-place-to-hold-objs>
  67. X
  68. X    MakeDir LTMP:uucp
  69. X    MakeDir LTMP:uucp/lib
  70. X    MakeDir LTMP:uucp/anews
  71. X    MakeDir LTMP:uucp/dnews
  72. X    MakeDir LTMP:uucp/dmail
  73. X
  74. X            (DICE)
  75. X
  76. X    Assign DTMP: <some-place-to-hold-objs>
  77. X
  78. X    MakeDir DTMP:uucp
  79. X    MakeDir DTMP:uucp/lib
  80. X    MakeDir DTMP:uucp/anews
  81. X    MakeDir DTMP:uucp/dnews
  82. X    MakeDir DTMP:uucp/dmail
  83. X
  84. X
  85. X    * WARNING 1.4 beta testers:  you must use the 1.3 C:List command,
  86. X      at least as of 1.4B2 List LFORMAT does not work.
  87. X
  88. X    * Make the whole shebang with the 'mkall' script in this directory,
  89. X      or make individual directories manually by CDing into them and
  90. X      running 'dmake'.  If the latter course is chosen be sure the
  91. X      link library 'lib' is made first.
  92. X
  93. X    Warning:    I have no source to the 'Tar' executable in uucp:c,
  94. X        be sure not to delete the executable accidently.
  95. X
  96. X
  97. END_OF_FILE
  98. if test 1374 -ne `wc -c <'uucp2/src/README'`; then
  99.     echo shar: \"'uucp2/src/README'\" unpacked with wrong size!
  100. fi
  101. # end of 'uucp2/src/README'
  102. fi
  103. if test -f 'uucp2/src/anews/sendpacket.c' -a "${1}" != "-c" ; then 
  104.   echo shar: Will not clobber existing file \"'uucp2/src/anews/sendpacket.c'\"
  105. else
  106. echo shar: Extracting \"'uucp2/src/anews/sendpacket.c'\" \(1959 characters\)
  107. sed "s/^X//" >'uucp2/src/anews/sendpacket.c' <<'END_OF_FILE'
  108. X/*
  109. X * Sendpacket.c
  110. X *
  111. X * An invaluable addition to your Amiga.lib file. This code sends a packet the
  112. X * given message port. This makes working around DOS lots easier.
  113. X *
  114. X * Note, I didn't write this, those wonderful folks at CBM did. I do suggest
  115. X * however that you may wish to add it to Amiga.Lib, to do so, compile it and
  116. X * say 'oml lib:amiga.lib -r sendpacket.o'
  117. X */
  118. X
  119. X#include <exec/types.h>
  120. X#include <exec/ports.h>
  121. X#include <exec/memory.h>
  122. X#include <libraries/dos.h>
  123. X#include <libraries/dosextens.h>
  124. X#include <protos.h>
  125. X
  126. X/*
  127. X * Function - SendPacket written by Phil Lindsay, Carolyn Scheppner, and Andy
  128. X * Finkel. This function will send a packet of the given type to the Message
  129. X * Port supplied.
  130. X */
  131. X
  132. Xlong
  133. XSendPacket(pid, action, args, nargs)
  134. Xstruct MsgPort    *pid;    /* process indentifier ... (handler's message port ) */
  135. Xlong        action, /* packet type ... (what you want handler to do )   */
  136. X        args[], /* a pointer to an argument list */
  137. X        nargs;    /* number of arguments in list    */
  138. X{
  139. X    struct MsgPort *replyport;
  140. X    struct StandardPacket *packet;
  141. X    long count, *pargs, res1;
  142. X
  143. X    replyport = CreatePort(NULL, 0L);
  144. X    if (!replyport)
  145. X        return (0);
  146. X
  147. X    /* Allocate space for a packet, make it public and clear it */
  148. X    packet = (struct StandardPacket *)
  149. X        AllocMem((long) sizeof(struct StandardPacket),
  150. X            MEMF_PUBLIC | MEMF_CLEAR);
  151. X    if (!packet) {
  152. X        DeletePort(replyport);
  153. X        return (0);
  154. X    }
  155. X    packet->sp_Msg.mn_Node.ln_Name = (char *) &(packet->sp_Pkt);
  156. X    packet->sp_Pkt.dp_Link = &(packet->sp_Msg);
  157. X    packet->sp_Pkt.dp_Port = replyport;
  158. X    packet->sp_Pkt.dp_Type = action;
  159. X
  160. X    /* copy the args into the packet */
  161. X    pargs = &(packet->sp_Pkt.dp_Arg1);      /* address of first argument */
  162. X    for (count = 0; count < nargs; count++)
  163. X        pargs[count] = args[count];
  164. X
  165. X    PutMsg(pid, packet);    /* send packet */
  166. X
  167. X    WaitPort(replyport);
  168. X    GetMsg(replyport);
  169. X
  170. X    res1 = packet->sp_Pkt.dp_Res1;
  171. X
  172. X    FreeMem(packet, (long) sizeof(struct StandardPacket));
  173. X    DeletePort(replyport);
  174. X
  175. X    return (res1);
  176. X}
  177. END_OF_FILE
  178. if test 1959 -ne `wc -c <'uucp2/src/anews/sendpacket.c'`; then
  179.     echo shar: \"'uucp2/src/anews/sendpacket.c'\" unpacked with wrong size!
  180. fi
  181. # end of 'uucp2/src/anews/sendpacket.c'
  182. fi
  183. if test -f 'uucp2/src/dmail/DMakefile' -a "${1}" != "-c" ; then 
  184.   echo shar: Will not clobber existing file \"'uucp2/src/dmail/DMakefile'\"
  185. else
  186. echo shar: Extracting \"'uucp2/src/dmail/DMakefile'\" \(1713 characters\)
  187. sed "s/^X//" >'uucp2/src/dmail/DMakefile' <<'END_OF_FILE'
  188. X
  189. X#
  190. X#   $Header: Beta:src/uucp/src/dmail/RCS/DMakefile,v 1.1 90/02/02 12:03:27 dillon Exp Locker: dillon $
  191. X#
  192. X#   Written by Matthew Dillon
  193. X#
  194. X#   (C)Copyright 1986-89 by Matthew Dillon
  195. X#
  196. X#   This code is completely original.  I declare this code to be public
  197. X#   domain.  You may redistribute this code as long as any those
  198. X#    redistributions contain this and all other files in their entirety.
  199. X#
  200. X#    Ports: Anybody may port this code to any machine or OS they wish, of
  201. X#    course.  If you do make a port, I would be grateful if you mailed
  202. X#    a letter with: (A) OS you ported it too, and (B) version ported,
  203. X#    so I may inform people who have mailed me wondering about ports
  204. X#    who to contact.
  205. X#
  206. X#   Send bug reports and other gripes to:
  207. X#
  208. X#   dillon@ucbvax.berkeley.edu           ARPA NET
  209. X#   ..!ihnp4!ucbvax!dillon           USENET
  210. X#
  211. X#   INSTRUCTIONS FOR COMPILING:
  212. X#
  213. X#   (1) Set DESTDIR & HELP_DIR to some global directory accessable to
  214. X#    everybody (or whatever).  Also set HELP_CHMOD and PROG_CHMOD
  215. X#    to the right thing if you don't like the defaults.
  216. X#
  217. X#   (2) Do ONE of the following:
  218. X#    make        -defaults to internal help file
  219. X#    make external    -external help file (executable is smaller)
  220. X#
  221. X#   (3) make install to install the file(s)
  222. X#
  223. X
  224. XOD= ltmp:uucp/dmail/
  225. XEXE= uucp:c/dmail
  226. XSYMS= uucp:src/lib/all.m
  227. XCFLAGS= -iuucp:src/include/
  228. X
  229. XLIBS=    ltmp:uucp/lib/uucp.lib lib:lc.lib lib:amiga.lib
  230. X
  231. XSRCS=    globals.c main.c do_lists.c sub.c execom.c commands.c \
  232. X    range.c load_mail.c sendmail.c set.c help.c cond.c compat.c
  233. X
  234. XOBJS=    $(SRCS:"*.c":"$(OD)*.o")
  235. X
  236. X$(EXE): $(OBJS)
  237. X    cd $(OD)
  238. X    list #?.o TO T:DMAILOBJS LFORMAT %s
  239. X    blink lib:c.o WITH T:DMAILOBJS LIB $(LIBS) TO %(left)
  240. X    cd
  241. X
  242. X$(OBJS) : $(SRCS)
  243. X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
  244. X
  245. END_OF_FILE
  246. if test 1713 -ne `wc -c <'uucp2/src/dmail/DMakefile'`; then
  247.     echo shar: \"'uucp2/src/dmail/DMakefile'\" unpacked with wrong size!
  248. fi
  249. # end of 'uucp2/src/dmail/DMakefile'
  250. fi
  251. if test -f 'uucp2/src/dmail/DMakefile.dcc' -a "${1}" != "-c" ; then 
  252.   echo shar: Will not clobber existing file \"'uucp2/src/dmail/DMakefile.dcc'\"
  253. else
  254. echo shar: Extracting \"'uucp2/src/dmail/DMakefile.dcc'\" \(1453 characters\)
  255. sed "s/^X//" >'uucp2/src/dmail/DMakefile.dcc' <<'END_OF_FILE'
  256. X
  257. X#
  258. X#   $Header: Beta:src/uucp/src/dmail/RCS/DMakefile,v 1.1 90/02/02 12:03:27 dillon Exp Locker: dillon $
  259. X#
  260. X#   Written by Matthew Dillon
  261. X#
  262. X#   (C)Copyright 1986-89 by Matthew Dillon
  263. X#
  264. X#   This code is completely original.  I declare this code to be public
  265. X#   domain.  You may redistribute this code as long as any those
  266. X#    redistributions contain this and all other files in their entirety.
  267. X#
  268. X#    Ports: Anybody may port this code to any machine or OS they wish, of
  269. X#    course.  If you do make a port, I would be grateful if you mailed
  270. X#    a letter with: (A) OS you ported it too, and (B) version ported,
  271. X#    so I may inform people who have mailed me wondering about ports
  272. X#    who to contact.
  273. X#
  274. X#   Send bug reports and other gripes to:
  275. X#
  276. X#   dillon@ucbvax.berkeley.edu           ARPA NET
  277. X#   ..!ihnp4!ucbvax!dillon           USENET
  278. X#
  279. X#   INSTRUCTIONS FOR COMPILING:
  280. X#
  281. X#   (1) Set DESTDIR & HELP_DIR to some global directory accessable to
  282. X#    everybody (or whatever).  Also set HELP_CHMOD and PROG_CHMOD
  283. X#    to the right thing if you don't like the defaults.
  284. X
  285. XOD= dtmp:uucp/dmail/
  286. XEXE= uucp:c/dmail
  287. XCFLAGS= -I uucp:src/include/
  288. X
  289. XLIBS=    dtmp:uucp/lib/uucp.lib
  290. X
  291. XSRCS=    globals.c main.c do_lists.c sub.c execom.c commands.c \
  292. X    range.c load_mail.c sendmail.c set.c help.c cond.c compat.c
  293. X
  294. XOBJS=    $(SRCS:"*.c":"$(OD)*.o")
  295. XLOBJS=    $(SRCS:"*.c":"*.o")
  296. X
  297. X$(EXE): $(OBJS)
  298. X    cd $(OD)
  299. X    dcc $(LOBJS) $(LIBS) -o %(left) -s -r
  300. X    cd
  301. X
  302. X$(OBJS) : $(SRCS)
  303. X    dcc $(CFLAGS) %(right) -o %(left) -c -r
  304. X
  305. END_OF_FILE
  306. if test 1453 -ne `wc -c <'uucp2/src/dmail/DMakefile.dcc'`; then
  307.     echo shar: \"'uucp2/src/dmail/DMakefile.dcc'\" unpacked with wrong size!
  308. fi
  309. # end of 'uucp2/src/dmail/DMakefile.dcc'
  310. fi
  311. if test -f 'uucp2/src/dmail/cond.c' -a "${1}" != "-c" ; then 
  312.   echo shar: Will not clobber existing file \"'uucp2/src/dmail/cond.c'\"
  313. else
  314. echo shar: Extracting \"'uucp2/src/dmail/cond.c'\" \(1461 characters\)
  315. sed "s/^X//" >'uucp2/src/dmail/cond.c' <<'END_OF_FILE'
  316. X
  317. X/*
  318. X * COND.C
  319. X *
  320. X *  $Header: Beta:src/uucp/src/dmail/RCS/cond.c,v 1.1 90/02/02 12:03:39 dillon Exp Locker: dillon $
  321. X *
  322. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  323. X *
  324. X * Conditional routines.
  325. X *
  326. X * if [!]variable
  327. X * else
  328. X * endif
  329. X *
  330. X */
  331. X
  332. X#include <stdio.h>
  333. X#include "dmail.h"
  334. X
  335. X#define MAXIF    16
  336. X
  337. Xstatic int Disable_if, Disable_case;
  338. X
  339. Xstatic int If_level;
  340. Xstatic char If_state[MAXIF];
  341. X
  342. Xdo_if()
  343. X{
  344. X    char *str = av[1];
  345. X    int result = 0;
  346. X
  347. X    if (ac != 2) {
  348. X    puts ("if: bad args");
  349. X    return(-1);
  350. X    }
  351. X    if (Disable_if) {
  352. X    ++Disable_if;
  353. X    return (1);
  354. X    }
  355. X    if (If_level == MAXIF) {
  356. X    puts ("Too many level's of IF's");
  357. X    return (-1);
  358. X    }
  359. X    if (*str == '!') {
  360. X    ++str;
  361. X    result = 1;
  362. X    }
  363. X    if (get_var(LEVEL_SET, str))
  364. X    result = 1 - result;
  365. X    if (!result)
  366. X    ++Disable_if;
  367. X    If_state[If_level++] = result;
  368. X    XDisable = Disable_if + Disable_case;
  369. X    return (1);
  370. X}
  371. X
  372. Xdo_else()
  373. X{
  374. X    if (Disable_if > 1)
  375. X    return (1);
  376. X    if (If_level < 1) {
  377. X    puts ("else without if");
  378. X    return (-1);
  379. X    }
  380. X    Disable_if = !(If_state[If_level - 1] = 1 - If_state[If_level - 1]);
  381. X    XDisable = Disable_if + Disable_case;
  382. X    return (1);
  383. X}
  384. X
  385. Xdo_endif()
  386. X{
  387. X    if (Disable_if == 1) {
  388. X    --If_level;
  389. X    Disable_if = 0;
  390. X    } else
  391. X    if (Disable_if > 1) {
  392. X    --Disable_if;
  393. X    } else {
  394. X    if (If_level == 0) {
  395. X        puts ("endif without if");
  396. X        return (-1);
  397. X    }
  398. X    --If_level;
  399. X    Disable_if = 0;
  400. X    }
  401. X    XDisable = Disable_if + Disable_case;
  402. X    return (1);
  403. X}
  404. X
  405. X
  406. END_OF_FILE
  407. if test 1461 -ne `wc -c <'uucp2/src/dmail/cond.c'`; then
  408.     echo shar: \"'uucp2/src/dmail/cond.c'\" unpacked with wrong size!
  409. fi
  410. # end of 'uucp2/src/dmail/cond.c'
  411. fi
  412. if test -f 'uucp2/src/dmail/dmkhelp.c' -a "${1}" != "-c" ; then 
  413.   echo shar: Will not clobber existing file \"'uucp2/src/dmail/dmkhelp.c'\"
  414. else
  415. echo shar: Extracting \"'uucp2/src/dmail/dmkhelp.c'\" \(1084 characters\)
  416. sed "s/^X//" >'uucp2/src/dmail/dmkhelp.c' <<'END_OF_FILE'
  417. X
  418. X/*
  419. X * DMKHELP.C
  420. X *
  421. X *  $Header: Beta:src/uucp/src/dmail/RCS/dmkhelp.c,v 1.1 90/02/02 12:04:11 dillon Exp Locker: dillon $
  422. X *
  423. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  424. X *
  425. X *  Standalone C source.
  426. X *
  427. X *  Takes the file DMAIL.HELP (or that specified), and puts quotes and
  428. X * commas around each line, the output to stdout.  Used by Makefile to
  429. X * place the help file on line (by making it a static array).  See the
  430. X * Makefile.
  431. X *
  432. X */
  433. X
  434. X#include <stdio.h>
  435. X#include <string.h>
  436. X
  437. X#define HELPC "dmail.help"
  438. X
  439. Xstatic char buf[1024];
  440. X
  441. Xmain(argc, argv)
  442. Xchar *argv[];
  443. X{
  444. X    FILE *fi;
  445. X    char *ptr;
  446. X    int len;
  447. X    register int i;
  448. X
  449. X    if (argc == 1)
  450. X    fi = fopen (HELPC, "r");
  451. X    else
  452. X    fi = fopen (argv[1], "r");
  453. X    if (fi == NULL) {
  454. X    puts ("CANNOT OPEN");
  455. X    exit (1);
  456. X    }
  457. X    while (fgets (buf, 1024, fi)) {
  458. X    len = strlen(buf) - 1;
  459. X    buf[len] = '\0';
  460. X    putchar ('\"');
  461. X    for (i = 0; i < len; ++i) {
  462. X        if (buf[i] == '\"') {
  463. X        putchar ('\\');
  464. X        putchar ('\"');
  465. X        } else {
  466. X        putchar (buf[i]);
  467. X        }
  468. X    }
  469. X    puts ("\",");
  470. X    }
  471. X    puts ("NULL");
  472. X    fclose (fi);
  473. X}
  474. X
  475. X
  476. END_OF_FILE
  477. if test 1084 -ne `wc -c <'uucp2/src/dmail/dmkhelp.c'`; then
  478.     echo shar: \"'uucp2/src/dmail/dmkhelp.c'\" unpacked with wrong size!
  479. fi
  480. # end of 'uucp2/src/dmail/dmkhelp.c'
  481. fi
  482. if test -f 'uucp2/src/dmail/globals.c' -a "${1}" != "-c" ; then 
  483.   echo shar: Will not clobber existing file \"'uucp2/src/dmail/globals.c'\"
  484. else
  485. echo shar: Extracting \"'uucp2/src/dmail/globals.c'\" \(2012 characters\)
  486. sed "s/^X//" >'uucp2/src/dmail/globals.c' <<'END_OF_FILE'
  487. X
  488. X/*
  489. X * GLOBALS.C
  490. X *
  491. X *  $Header: Beta:src/uucp/src/dmail/RCS/globals.c,v 1.1 90/02/02 12:04:02 dillon Exp Locker: dillon $
  492. X *
  493. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  494. X *
  495. X *  Declarations for most global variables.
  496. X *
  497. X */
  498. X
  499. X#include <stdio.h>
  500. X#include "dmail.h"
  501. X
  502. XFILE *m_fi;                /* open file ptr to spool file  */
  503. Xchar *mail_file;            /* name of from (spool) file    */
  504. Xchar *output_file;            /* name of out file (i.e. mbox) */
  505. Xchar *user_name;            /* user name from password entry*/
  506. Xchar *home_dir;             /* home directory of user        */
  507. Xchar *visual;                /* visual editor path        */
  508. Xchar Buf[MAXFIELDSIZE];         /* Scratch Buffer            */
  509. Xchar Puf[MAXFIELDSIZE];         /* Another Scratch Buffer        */
  510. Xjmp_buf env[LONGSTACK];         /* Holds longjump (break) stack */
  511. Xint  Did_cd;                /* Set if user does a CD        */
  512. Xint  XDebug;                /* Debug mode            */
  513. Xint  Longstack, Breakstack;        /* longjump/break level stack   */
  514. Xint  Entries, Current;            /* #Entries and Current entry   */
  515. Xint  XDisable;                /* Disable non-cond comm exec.  */
  516. Xint  ac;                /* internal argc, from/to stat  */
  517. Xint  No_load_mail;            /* disable loading of mail        */
  518. Xint  lmessage_overide;            /* Overide initial 'X items ... */
  519. Xint  Silence;                /* -s command option status     */
  520. Xint  SelAll = 1;            /* last select was sel all        */
  521. Xstruct ENTRY *Entry;            /* Base of Entry list        */
  522. Xchar *av[128];                /* internal argv[]            */
  523. Xchar *Nulav[3] = { "", "", NULL };
  524. X
  525. Xint width[MAXLIST]  = { 18, 38, 10 };    /* Default setlist params    */
  526. Xint header[MAXLIST] = {  0,  2,  1 };
  527. Xint Listsize = 3;
  528. X
  529. X/* The following are globals variables definable from the 'set' command */
  530. X
  531. Xchar  *S_sendmail;            /* sendmail program path        */
  532. Xint   S_page;                /* Paging status            */
  533. Xint   S_novibreak;            /* vi-break status            */
  534. Xint   S_verbose;            /* sendmail verbose status        */
  535. Xint   S_ask;                /* Ask what to do after mail ed */
  536. Xint   S_archive;            /* Archive sent mail        */
  537. X
  538. END_OF_FILE
  539. if test 2012 -ne `wc -c <'uucp2/src/dmail/globals.c'`; then
  540.     echo shar: \"'uucp2/src/dmail/globals.c'\" unpacked with wrong size!
  541. fi
  542. # end of 'uucp2/src/dmail/globals.c'
  543. fi
  544. if test -f 'uucp2/src/getty/passwd.c' -a "${1}" != "-c" ; then 
  545.   echo shar: Will not clobber existing file \"'uucp2/src/getty/passwd.c'\"
  546. else
  547. echo shar: Extracting \"'uucp2/src/getty/passwd.c'\" \(1795 characters\)
  548. sed "s/^X//" >'uucp2/src/getty/passwd.c' <<'END_OF_FILE'
  549. X
  550. X/*
  551. X *  PASSWD.C
  552. X *
  553. X *  $Header: Beta:src/uucp/src/getty/RCS/passwd.c,v 1.1 90/02/02 12:13:35 dillon Exp Locker: dillon $
  554. X *
  555. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  556. X *
  557. X */
  558. X
  559. X#include <exec/types.h>
  560. X#include <libraries/dosextens.h>
  561. X#include <stdio.h>
  562. X#include <stdlib.h>
  563. X#include <pwd.h>
  564. X#include "protos.h"
  565. X
  566. X#include "log.h"
  567. X
  568. X#define BTOCP(bp,type)  ((type)((long)bp << 2))
  569. X
  570. Xextern long NullFH;
  571. Xextern char LoginBuf[];
  572. Xextern char PasswdBuf[];
  573. Xextern char *DeviceName;
  574. Xextern long DeviceUnit;
  575. X
  576. Xstatic struct passwd *Pas;
  577. X
  578. XCheckLoginAndPassword()
  579. X{
  580. X    Pas = getpwnam(LoginBuf);
  581. X
  582. X    if (Pas == NULL)
  583. X    return(0);
  584. X    if (strcmp(Pas->pw_passwd, "*") == 0)
  585. X    return(1);
  586. X    if (strcmp(PasswdBuf, Pas->pw_passwd) == 0)
  587. X    return(1);
  588. X    return(0);
  589. X}
  590. X
  591. Xvoid
  592. XRunPasswdEntry()
  593. X{
  594. X    static char buf[256];
  595. X    static char redir[128];
  596. X    char *arg0 = Pas->pw_shell_arg0;
  597. X    struct Process *proc = (struct Process *)FindTask(NULL);
  598. X    APTR oldConsoleTask = proc->pr_ConsoleTask;
  599. X    BPTR oldDir;
  600. X    BPTR DirLock;
  601. X
  602. X    strcpy(redir, " ");
  603. X
  604. X    if (*arg0 == '*') {
  605. X    ++arg0;
  606. X    sprintf(redir, " >UUSER:%s/%d/R300000G1 <UUSER:%s/%d/R300000G1 ", DeviceName, DeviceUnit, DeviceName, DeviceUnit);
  607. X    } else {
  608. X    if (LogToStdout == 0)
  609. X        strcpy(redir, " >null: <null: ");
  610. X    }
  611. X    if (LogToStdout == 0)
  612. X    proc->pr_ConsoleTask = (APTR)BTOCP(NullFH, struct FileHandle *)->fh_Port;
  613. X
  614. X    sprintf(buf, "%s%s%s -Getty -DEVICE %s -UNIT %d", arg0, redir, Pas->pw_shell_argn, DeviceName, DeviceUnit);
  615. X
  616. X    DirLock = (BPTR)Lock(Pas->pw_dir, SHARED_LOCK);
  617. X    if (DirLock)
  618. X    oldDir = (BPTR)CurrentDir(DirLock);
  619. X
  620. X    ulog(1, "Execute %s\n", buf);
  621. X
  622. X    Execute(buf, NullFH, NullFH);
  623. X
  624. X    proc->pr_ConsoleTask = oldConsoleTask;
  625. X
  626. X    if (DirLock)
  627. X    UnLock(CurrentDir(oldDir));
  628. X
  629. X    ulog(1, "ran\n");
  630. X}
  631. X
  632. END_OF_FILE
  633. if test 1795 -ne `wc -c <'uucp2/src/getty/passwd.c'`; then
  634.     echo shar: \"'uucp2/src/getty/passwd.c'\" unpacked with wrong size!
  635. fi
  636. # end of 'uucp2/src/getty/passwd.c'
  637. fi
  638. if test -f 'uucp2/src/include/dnews_protos.h' -a "${1}" != "-c" ; then 
  639.   echo shar: Will not clobber existing file \"'uucp2/src/include/dnews_protos.h'\"
  640. else
  641. echo shar: Extracting \"'uucp2/src/include/dnews_protos.h'\" \(1838 characters\)
  642. sed "s/^X//" >'uucp2/src/include/dnews_protos.h' <<'END_OF_FILE'
  643. X
  644. X/* MACHINE GENERATED */
  645. X
  646. X
  647. X/* main.c               */
  648. X
  649. XPrototype char *FileForArticle(NGroup *, int);
  650. X
  651. X/* group.c              */
  652. X
  653. XPrototype void LoadGroups(char *);
  654. XPrototype void UnloadGroups(char *);
  655. XPrototype void CreateNewsrc(char *);
  656. XPrototype void RangeAdd(Range **, short, short);
  657. XPrototype void RangeDel(Range **, short, short);
  658. XPrototype int  NextInRange(Range *, short);
  659. XPrototype int  NextNotInRange(Range *, short);
  660. XPrototype void ClearGroupCache(NGroup *);
  661. XPrototype FNode **FindFNCache(FNode **, long);
  662. XPrototype void AddFNCache(FNode **, long, char *);
  663. X
  664. X/* display.c            */
  665. X
  666. XPrototype int getyn(char *);
  667. XPrototype void *OpenBrowseDisplay(char *, char *, short);
  668. XPrototype void CloseBrowseDisplay(void *);
  669. XPrototype void ChangeBrowseDisplay(void *, char *, char *);
  670. XPrototype int WaitBrowseEvent(void **, int *, int *);
  671. XPrototype void    LoadDisplayConfig(void);
  672. XPrototype void    SaveDisplayConfig(void);
  673. X
  674. X/* subs.c               */
  675. X
  676. XPrototype void FindUser(char *, int);
  677. XPrototype void ScanNewsDirs(void (*)(), long);
  678. XPrototype char *FindField(FILE *, char *);
  679. XPrototype int  FileExists(char *);
  680. X
  681. X/* filereq.c            */
  682. X
  683. XPrototype char *GetFileName(int);
  684. X
  685. X/* edit.c               */
  686. X
  687. XPrototype void ReplyArticle(short, NGroup *);
  688. XPrototype void FollowUpArticle(short, NGroup *);
  689. XPrototype void PostArticle(NGroup *);
  690. X
  691. X/* postnews.c           */
  692. X
  693. XPrototype void PostNews(FILE *, char *);
  694. X
  695. X/* refs.c               */
  696. X
  697. XPrototype void AddKillFile(char *, int);
  698. XPrototype void RemKillFile(char *);
  699. XPrototype void LoadKillFile(char *);
  700. XPrototype void SaveKillFile(char *);
  701. XPrototype char *ReferenceLineOf(NGroup *, int);
  702. XPrototype char *NewsMessageIdOf(NGroup *, int);
  703. XPrototype int FindArticleReferencing(NGroup *, char *, int);
  704. XPrototype int ArticleRefNotKilled(NGroup *, char *, int);
  705. XPrototype char *NextRef(char **);
  706. END_OF_FILE
  707. if test 1838 -ne `wc -c <'uucp2/src/include/dnews_protos.h'`; then
  708.     echo shar: \"'uucp2/src/include/dnews_protos.h'\" unpacked with wrong size!
  709. fi
  710. # end of 'uucp2/src/include/dnews_protos.h'
  711. fi
  712. if test -f 'uucp2/src/include/ndir.h' -a "${1}" != "-c" ; then 
  713.   echo shar: Will not clobber existing file \"'uucp2/src/include/ndir.h'\"
  714. else
  715. echo shar: Extracting \"'uucp2/src/include/ndir.h'\" \(1133 characters\)
  716. sed "s/^X//" >'uucp2/src/include/ndir.h' <<'END_OF_FILE'
  717. X
  718. X/*
  719. X *  ndir.h -- header file for the ``ndir'' directory routines.
  720. X *
  721. X */
  722. X
  723. X#ifndef _NDIR_H
  724. X#define _NDIR_H
  725. X
  726. X#ifndef LIBRARIES_DOS_H
  727. X#include <libraries/dos.h>
  728. X#endif
  729. X
  730. X#ifndef DEV_BSIZE
  731. X#define DEV_BSIZE     512
  732. X#endif
  733. X
  734. X#define DIRBLKSIZ    DEV_BSIZE
  735. X#define MAXNAMLEN    255
  736. X
  737. Xstruct    direct {
  738. X    long    d_ino;            /* inode number of entry */
  739. X    short   d_reclen;            /* length of this record */
  740. X    short   d_namlen;            /* length of string in d_name */
  741. X    char    d_name[MAXNAMLEN + 1];  /* name must be no longer than this */
  742. X};
  743. X
  744. X/*
  745. X * The DIRSIZ macro gives the minimum record length which will hold
  746. X * the directory entry.  This requires the amount of space in struct direct
  747. X * without the d_name field, plus enough space for the name with a
  748. X * terminating null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  749. X */
  750. X
  751. X#ifdef DIRSIZ
  752. X#undef DIRSIZ
  753. X#endif /* DIRSIZ */
  754. X
  755. X#define DIRSIZ(dp) \
  756. X    ((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  757. X
  758. X/*
  759. X * Definitions for library routines operating on directories.
  760. X */
  761. X
  762. Xtypedef struct _dirdesc {
  763. X    long lock;
  764. X    struct FileInfoBlock fib;
  765. X} DIR;
  766. X
  767. X#endif
  768. X
  769. END_OF_FILE
  770. if test 1133 -ne `wc -c <'uucp2/src/include/ndir.h'`; then
  771.     echo shar: \"'uucp2/src/include/ndir.h'\" unpacked with wrong size!
  772. fi
  773. # end of 'uucp2/src/include/ndir.h'
  774. fi
  775. if test -f 'uucp2/src/include/news.h' -a "${1}" != "-c" ; then 
  776.   echo shar: Will not clobber existing file \"'uucp2/src/include/news.h'\"
  777. else
  778. echo shar: Extracting \"'uucp2/src/include/news.h'\" \(1214 characters\)
  779. sed "s/^X//" >'uucp2/src/include/news.h' <<'END_OF_FILE'
  780. X
  781. X#include <stdlib.h>
  782. X#include <stdio.h>
  783. X#include <string.h>
  784. X#include "version.h"
  785. X
  786. Xextern int NumRows;
  787. Xextern int NumCols;
  788. X
  789. X/* anews.c */
  790. Xextern void initgroups(void);
  791. Xextern char *Get_Env(char *envar, char *def);
  792. Xextern void init(void);
  793. Xextern char *subs(char *newsfile);
  794. Xextern void do_quit(void);
  795. Xextern void do_help(char **pp);
  796. Xextern char *art2file(char *group, char *art);
  797. Xextern int readgroup(char *group);
  798. Xextern void scr_inverse_on(void);
  799. Xextern void scr_inverse_off(void);
  800. Xextern int rawch(void);
  801. X
  802. X/* showart.c */
  803. Xextern void scan_subjects(char *group);
  804. Xextern int showart(char *group, char *article);
  805. X
  806. X/* reply.c */
  807. Xextern struct hdrinfo *openhdr(FILE *fp);
  808. Xextern void closehdr(struct hdrinfo *hdr);
  809. Xextern void reply(int, FILE *, const char *);
  810. X
  811. X/* mscan.c */
  812. Xextern void free_directory(int);
  813. Xextern int scan_directory(char *dir);
  814. Xextern char *first_unread(void);
  815. Xextern int unread_count(void);
  816. Xextern char *goto_article(char *name);
  817. Xextern char *get_next_art(void);
  818. Xextern char *get_prev_art(void);
  819. Xextern void rewind_arts(void);
  820. Xextern void mark_cur_art(int flag);
  821. Xextern void del_cur_art(int flag);
  822. Xextern void hold_cur_art(void);
  823. X
  824. X/* manx.c */
  825. Xextern int raw(FILE *f);
  826. Xextern int cooked(FILE *f);
  827. X
  828. END_OF_FILE
  829. if test 1214 -ne `wc -c <'uucp2/src/include/news.h'`; then
  830.     echo shar: \"'uucp2/src/include/news.h'\" unpacked with wrong size!
  831. fi
  832. # end of 'uucp2/src/include/news.h'
  833. fi
  834. if test -f 'uucp2/src/lib/DMakefile' -a "${1}" != "-c" ; then 
  835.   echo shar: Will not clobber existing file \"'uucp2/src/lib/DMakefile'\"
  836. else
  837. echo shar: Extracting \"'uucp2/src/lib/DMakefile'\" \(1177 characters\)
  838. sed "s/^X//" >'uucp2/src/lib/DMakefile' <<'END_OF_FILE'
  839. X
  840. X#   DMakefile    For Lattice V5.02
  841. X#
  842. X#   $Header: Beta:src/uucp/src/lib/RCS/DMakefile,v 1.1 90/02/02 12:08:16 dillon Exp Locker: dillon $
  843. X#
  844. X#   NOTE: Lattice C users, ignore all the const warnings, they are bugs in
  845. X#      Lattice's header files.
  846. X
  847. XOD = ltmp:uucp/lib/
  848. XEXE = $(OD)uucp.lib
  849. XSYMS = all.m
  850. XPROTOS= uucp:src/include/lib_protos.h
  851. X
  852. XSRCS = getpwnam.c serialport.c setstdin.c sleep.c validuser.c lsys.c \
  853. X   mntreq.c security.c log.c lockfile.c tmpfile.c seq.c getenv.c \
  854. X   config.c alias.c string.c getfiles.c ndir.c list_sort.c \
  855. X   expand_path.c isdir.c getuser.c
  856. X
  857. XOBJS = $(SRCS:"*.c":"$(OD)*.o")
  858. X
  859. XCFLAGS= -iuucp:src/include/ -cq
  860. X
  861. Xall : $(PROTOS) $(EXE)
  862. X
  863. X$(EXE) : $(SYMS) $(OBJS)
  864. X    list LFORMAT $(OD)%s TO $(OD)list.lst $(OD)#?.o
  865. X    oml %(left) r @$(OD)list.lst
  866. X    filenote %(left) NODIST
  867. X
  868. X$(OBJS) : $(SRCS)
  869. X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
  870. X
  871. X$(SYMS) : syms.c
  872. X    lc $(CFLAGS) -ph -o$(SYMS) syms.c
  873. X    filenote %(left) NODIST
  874. X
  875. X$(PROTOS) : $(SRCS) $(OD)makeproto
  876. X    $(OD)makeproto -o%(left) $(SRCS)
  877. X
  878. X$(OD)makeproto : makeproto.c
  879. X    lc $(CFLAGS) -oram:makeproto.o makeproto.c
  880. X    blink lib:c.o ram:makeproto.o to %(left) lib lib:lc.lib lib:amiga.lib SC SD
  881. X
  882. END_OF_FILE
  883. if test 1177 -ne `wc -c <'uucp2/src/lib/DMakefile'`; then
  884.     echo shar: \"'uucp2/src/lib/DMakefile'\" unpacked with wrong size!
  885. fi
  886. # end of 'uucp2/src/lib/DMakefile'
  887. fi
  888. if test -f 'uucp2/src/lib/DMakefile.dcc' -a "${1}" != "-c" ; then 
  889.   echo shar: Will not clobber existing file \"'uucp2/src/lib/DMakefile.dcc'\"
  890. else
  891. echo shar: Extracting \"'uucp2/src/lib/DMakefile.dcc'\" \(1266 characters\)
  892. sed "s/^X//" >'uucp2/src/lib/DMakefile.dcc' <<'END_OF_FILE'
  893. X
  894. X#   DMakefile    For Lattice V5.02
  895. X#
  896. X#   $Header: Beta:src/uucp/src/lib/RCS/DMakefile,v 1.1 90/02/02 12:08:16 dillon Exp Locker: dillon $
  897. X#
  898. X#   NOTE: Lattice C users, ignore all the const warnings, they are bugs in
  899. X#      Lattice's header files.
  900. X
  901. XOD = dtmp:uucp/lib/
  902. XEXE = $(OD)uucp.lib
  903. XPROTOS= uucp:src/include/lib_protos.h
  904. X
  905. XSRC1 = getpwnam.c serialport.c setstdin.c sleep.c validuser.c lsys.c
  906. XSRC2 = mntreq.c security.c log.c lockfile.c tmpfile.c seq.c getenv.c
  907. XSRC3 = config.c alias.c string.c getfiles.c ndir.c list_sort.c
  908. XSRC4 = expand_path.c isdir.c getuser.c
  909. X
  910. XSRCS= $(SRC1) $(SRC2) $(SRC3) $(SRC4)
  911. X
  912. XOBJS = $(SRCS:"*.c":"$(OD)*.o")
  913. X
  914. XLOBJ1= $(SRC1:"*.c":"*.o")
  915. XLOBJ2= $(SRC2:"*.c":"*.o")
  916. XLOBJ3= $(SRC3:"*.c":"*.o")
  917. XLOBJ4= $(SRC4:"*.c":"*.o")
  918. X
  919. XCFLAGS= -I uucp:src/include/
  920. X
  921. Xall : $(PROTOS) $(EXE)
  922. X
  923. X$(EXE) : $(OBJS)
  924. X    cd $(OD)
  925. X    join $(LOBJ1) as ram:j1
  926. X    join $(LOBJ2) as ram:j2
  927. X    join $(LOBJ3) as ram:j3
  928. X    join $(LOBJ4) as ram:j4
  929. X    join ram:j1 ram:j2 ram:j3 ram:j4 as %(left)
  930. X    delete ram:j1 ram:j2 ram:j3 ram:j4
  931. X    cd
  932. X
  933. X$(OBJS) : $(SRCS)
  934. X    dcc $(CFLAGS) -o %(left) %(right) -c -r
  935. X
  936. X$(PROTOS) : $(SRCS) $(OD)makeproto
  937. X    $(OD)makeproto -o%(left) $(SRCS)
  938. X
  939. X$(OD)makeproto : makeproto.c
  940. X    dcc $(CFLAGS) makeproto.c -o %(left)
  941. X    delete T:makeproto.o
  942. X
  943. END_OF_FILE
  944. if test 1266 -ne `wc -c <'uucp2/src/lib/DMakefile.dcc'`; then
  945.     echo shar: \"'uucp2/src/lib/DMakefile.dcc'\" unpacked with wrong size!
  946. fi
  947. # end of 'uucp2/src/lib/DMakefile.dcc'
  948. fi
  949. if test -f 'uucp2/src/lib/getfiles.c' -a "${1}" != "-c" ; then 
  950.   echo shar: Will not clobber existing file \"'uucp2/src/lib/getfiles.c'\"
  951. else
  952. echo shar: Extracting \"'uucp2/src/lib/getfiles.c'\" \(1487 characters\)
  953. sed "s/^X//" >'uucp2/src/lib/getfiles.c' <<'END_OF_FILE'
  954. X
  955. X/*
  956. X *  GETFILES.C
  957. X */
  958. X
  959. X#include <stddef.h>
  960. X#include <stdio.h>
  961. X#include <stdlib.h>
  962. X#include <string.h>
  963. X#include "getfiles.h"
  964. X#include "ndir.h"
  965. X#include "version.h"
  966. X
  967. XIDENT(".01");
  968. X
  969. XPrototype dir_list *getfiles(const char *, int, int (*)(char *), int (*)(dir_list *, dir_list *));
  970. X
  971. Xdir_list *
  972. Xgetfiles(dir, gap, sel, cmp)
  973. Xconst char *dir;
  974. Xint gap;
  975. Xint (*sel)(char *);
  976. Xint (*cmp)(dir_list *, dir_list *);
  977. X{
  978. X    register DIR *dirp;
  979. X    register struct direct *dp;
  980. X    register dir_list *this;
  981. X    dir_list *first = NULL;    /*  assignment avoids warning, not reqd */
  982. X
  983. X    if ((dirp = opendir(dir)) == NULL)
  984. X    return NULL;
  985. X
  986. X    this = (dir_list *)&first;
  987. X    while (dp = readdir(dirp)) {
  988. X    if (sel == NULL || (*sel)(dp->d_name)) {
  989. X        this->next = malloc(offsetof(dir_list, name)
  990. X                + gap
  991. X                + strlen(dp->d_name)
  992. X                + 1
  993. X                   );
  994. X        if ((this = this->next) == NULL)
  995. X        break;
  996. X        strcpy(this->name + gap, dp->d_name);
  997. X    }
  998. X    }
  999. X    this->next = NULL;
  1000. X    closedir(dirp);
  1001. X
  1002. X    if (cmp == NULL)
  1003. X    return first;
  1004. X    return list_sort(first, (int (*)(void *, void *))cmp);
  1005. X}
  1006. X
  1007. X
  1008. X#ifdef TEST
  1009. X
  1010. Xsel(a)
  1011. Xchar *a;
  1012. X{
  1013. X    while (*a != '\0')
  1014. X        if (*a++ == '.' && *a == 'o')
  1015. X            return 1;
  1016. X    return 0;
  1017. X}
  1018. X
  1019. Xcmp(a, b)
  1020. Xdir_list *a, *b;
  1021. X{
  1022. X    return strcmp(a->name, b->name);
  1023. X}
  1024. X
  1025. Xmain()
  1026. X{
  1027. X    register dir_list *p, *q;
  1028. X
  1029. X    p = getfiles("", 0, (void *)NULL, (void *)NULL);
  1030. X    while (p)
  1031. X        puts(p->name), q = p->next, free(p), p = q;
  1032. X
  1033. X    p = getfiles("", sel, cmp);
  1034. X    while (p)
  1035. X        puts(p->name), q = p->next, free(p), p = q;
  1036. X}
  1037. X
  1038. X#endif
  1039. X
  1040. END_OF_FILE
  1041. if test 1487 -ne `wc -c <'uucp2/src/lib/getfiles.c'`; then
  1042.     echo shar: \"'uucp2/src/lib/getfiles.c'\" unpacked with wrong size!
  1043. fi
  1044. # end of 'uucp2/src/lib/getfiles.c'
  1045. fi
  1046. if test -f 'uucp2/src/lib/getpwnam.c' -a "${1}" != "-c" ; then 
  1047.   echo shar: Will not clobber existing file \"'uucp2/src/lib/getpwnam.c'\"
  1048. else
  1049. echo shar: Extracting \"'uucp2/src/lib/getpwnam.c'\" \(2071 characters\)
  1050. sed "s/^X//" >'uucp2/src/lib/getpwnam.c' <<'END_OF_FILE'
  1051. X
  1052. X/*
  1053. X *  GETPWNAM.C
  1054. X *
  1055. X *  $Header: Beta:src/uucp/src/lib/RCS/getpwnam.c,v 1.1 90/02/02 12:08:26 dillon Exp Locker: dillon $
  1056. X *
  1057. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1058. X *
  1059. X *  (UUCP source support)
  1060. X */
  1061. X
  1062. X#include <stdio.h>
  1063. X#include <stdlib.h>
  1064. X#include <pwd.h>
  1065. X#include "config.h"
  1066. X
  1067. XPrototype struct passwd *getpwnam(const char *);
  1068. X
  1069. XLocal char *Breakout(char **);
  1070. X
  1071. Xchar *PasswdFile;
  1072. X
  1073. Xstruct passwd *
  1074. Xgetpwnam(name)
  1075. Xconst char *name;
  1076. X{
  1077. X    FILE *fi;
  1078. X    char *buf = malloc(256);
  1079. X    static char User[32];
  1080. X    static char Passwd[32];
  1081. X    static char Dir[128];
  1082. X    static char Shell[256];
  1083. X    static struct passwd Pas = { User, Passwd, 0, 0, 0, "", "", Dir, Shell };
  1084. X
  1085. X    if (PasswdFile)
  1086. X    fi = fopen(PasswdFile, "r");
  1087. X    else
  1088. X    fi = fopen(MakeConfigPath(UULIB, "Passwd"), "r");
  1089. X
  1090. X    if (fi == NULL)
  1091. X    return(NULL);
  1092. X
  1093. X    while (fgets(buf, 256, fi)) {
  1094. X    char *ptr = buf;
  1095. X    char *arg;
  1096. X
  1097. X    arg = Breakout(&ptr);
  1098. X    if (strcmp(name, arg) != 0)
  1099. X        continue;
  1100. X    strcpy(Pas.pw_name, arg);
  1101. X    strcpy(Pas.pw_passwd, Breakout(&ptr));
  1102. X    Pas.pw_uid = atoi(Breakout(&ptr));
  1103. X    Pas.pw_gid = atoi(Breakout(&ptr));
  1104. X    Breakout(&ptr);     /*  finger info */
  1105. X    strcpy(Pas.pw_dir, Breakout(&ptr));
  1106. X    strcpy(Pas.pw_shell, Breakout(&ptr));
  1107. X
  1108. X    {
  1109. X        short i = strlen(Pas.pw_dir) - 1;
  1110. X        if (i >= 0 && Pas.pw_dir[i] != ':' && Pas.pw_dir[i] != '/') {
  1111. X        Pas.pw_dir[i++] = '/';
  1112. X        Pas.pw_dir[i] = 0;
  1113. X        }
  1114. X    }
  1115. X
  1116. X    {
  1117. X        char *str;
  1118. X
  1119. X        Pas.pw_shell_arg0 = Pas.pw_shell;
  1120. X        for (str = Pas.pw_shell; *str && *str != ' ' && *str != 9; ++str);
  1121. X        if (*str) {
  1122. X        *str = 0;
  1123. X        ++str;
  1124. X        while (*str == ' ' || *str == 9)
  1125. X            ++str;
  1126. X        Pas.pw_shell_argn = str;
  1127. X        } else {
  1128. X        Pas.pw_shell_argn = str;
  1129. X        }
  1130. X    }
  1131. X
  1132. X
  1133. X    fclose(fi);
  1134. X    return(&Pas);
  1135. X    }
  1136. X    fclose(fi);
  1137. X    return(NULL);
  1138. X}
  1139. X
  1140. Xstatic
  1141. Xchar *
  1142. XBreakout(pptr)
  1143. Xchar **pptr;
  1144. X{
  1145. X    char *base;
  1146. X    char *ptr;
  1147. X
  1148. X    base = *pptr;
  1149. X    if (base == NULL)
  1150. X    return("");
  1151. X    for (ptr = base; *ptr && *ptr != '\n' && *ptr != ','; ++ptr);
  1152. X    if (*ptr == ',') {
  1153. X    *pptr = ptr + 1;
  1154. X    *ptr = 0;
  1155. X    } else {
  1156. X    *pptr = NULL;
  1157. X    *ptr = 0;
  1158. X    }
  1159. X    return(base);
  1160. X}
  1161. X
  1162. END_OF_FILE
  1163. if test 2071 -ne `wc -c <'uucp2/src/lib/getpwnam.c'`; then
  1164.     echo shar: \"'uucp2/src/lib/getpwnam.c'\" unpacked with wrong size!
  1165. fi
  1166. # end of 'uucp2/src/lib/getpwnam.c'
  1167. fi
  1168. if test -f 'uucp2/src/lib/log.c' -a "${1}" != "-c" ; then 
  1169.   echo shar: Will not clobber existing file \"'uucp2/src/lib/log.c'\"
  1170. else
  1171. echo shar: Extracting \"'uucp2/src/lib/log.c'\" \(1589 characters\)
  1172. sed "s/^X//" >'uucp2/src/lib/log.c' <<'END_OF_FILE'
  1173. X
  1174. X/*
  1175. X *  LOG.C
  1176. X *
  1177. X *  $Header: Beta:src/uucp/src/lib/RCS/log.c,v 1.1 90/02/02 12:08:38 dillon Exp Locker: dillon $
  1178. X *
  1179. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1180. X *
  1181. X *  ulog(level, ctl, args...)
  1182. X */
  1183. X
  1184. X#include <stdio.h>
  1185. X#include <stdlib.h>
  1186. X#include <fcntl.h>
  1187. X#include <time.h>
  1188. X
  1189. X#include "log.h"
  1190. X#include "config.h"
  1191. X
  1192. XPrototype void ulog(int, const char *, ...);
  1193. X
  1194. Xint    LogLevel = -1;
  1195. Xint    LogToStdout = 0;
  1196. Xchar    *LogProgram = "-";
  1197. Xchar    *LogHost = "-";
  1198. Xchar    *LogWho = "-";
  1199. Xchar    *LogFile;
  1200. Xchar    LogBuf[512];
  1201. X
  1202. Xvoid
  1203. Xulog(level, ctl)
  1204. Xint level;
  1205. Xconst char *ctl;
  1206. X{
  1207. X    long clock;
  1208. X    struct tm *ut;
  1209. X    int logfd;
  1210. X    int len;
  1211. X    char *logFile;
  1212. X    long *args = (long *)&ctl + 1;  /*  should use varargs  */
  1213. X
  1214. X    if (LogFile)
  1215. X    logFile = LogFile;
  1216. X    else
  1217. X    logFile = MakeConfigPath(UUSPOOL, "LOGFILE");
  1218. X
  1219. X    if (level > LogLevel)
  1220. X    return;
  1221. X
  1222. X    (void)time(&clock);
  1223. X    ut = localtime(&clock);
  1224. X
  1225. X    sprintf(LogBuf, "(%02d/%02d-%02d:%02d:%02d) %s,%s,%s ",
  1226. X    ut->tm_mon+1, ut->tm_mday, ut->tm_hour, ut->tm_min, ut->tm_sec,
  1227. X    LogProgram,
  1228. X    LogHost,
  1229. X    LogWho
  1230. X    );
  1231. X    sprintf(LogBuf + strlen(LogBuf), ctl,
  1232. X    args[0], args[1], args[2],
  1233. X    args[3], args[4], args[5]
  1234. X    );
  1235. X
  1236. X    len = strlen(LogBuf);
  1237. X    LogBuf[len++] = '\n';
  1238. X    LogBuf[len] = 0;
  1239. X
  1240. X    DEBUG(0, "%s", LogBuf);
  1241. X
  1242. X    if (LogToStdout) {
  1243. X    write(1, LogBuf, len);
  1244. X    return;
  1245. X    }
  1246. X    LockFile("LOG-UPDATE");
  1247. X    logfd = open(logFile, O_CREAT|O_WRONLY|O_APPEND, 0644);
  1248. X    if (logfd >= 0) {
  1249. X    write(logfd, LogBuf, len);
  1250. X    close(logfd);
  1251. X    } else {
  1252. X    fprintf(stderr, "Can't open %s\n", logFile);
  1253. X    }
  1254. X    UnLockFile("LOG-UPDATE");
  1255. X}
  1256. X
  1257. END_OF_FILE
  1258. if test 1589 -ne `wc -c <'uucp2/src/lib/log.c'`; then
  1259.     echo shar: \"'uucp2/src/lib/log.c'\" unpacked with wrong size!
  1260. fi
  1261. # end of 'uucp2/src/lib/log.c'
  1262. fi
  1263. if test -f 'uucp2/src/sendmail/parse.c' -a "${1}" != "-c" ; then 
  1264.   echo shar: Will not clobber existing file \"'uucp2/src/sendmail/parse.c'\"
  1265. else
  1266. echo shar: Extracting \"'uucp2/src/sendmail/parse.c'\" \(1395 characters\)
  1267. sed "s/^X//" >'uucp2/src/sendmail/parse.c' <<'END_OF_FILE'
  1268. X
  1269. X/*
  1270. X *  PARSE.C
  1271. X *
  1272. X *  $Header: Beta:src/uucp/src/sendmail/RCS/parse.c,v 1.1 90/02/02 12:15:05 dillon Exp Locker: dillon $
  1273. X *
  1274. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1275. X */
  1276. X
  1277. X#include "defs.h"
  1278. X
  1279. XPrototype int ParseAddress(char *, char *, int);
  1280. X
  1281. XLocal char *ParseAddress2(char *, char *, int);
  1282. X
  1283. X/*
  1284. X *  PARSEADDRESS()
  1285. X *
  1286. X *  Takes an address containing ! @ % : and converts it to a level 3 ! path.
  1287. X *
  1288. X *  [path]@mach     ->  mach[!path]
  1289. X *  [path]%mach     ->  mach[!path]
  1290. X *  patha:pathb     ->  patha!pathb
  1291. X *  patha:pathb:pathc    ->  patha!pathb!pathc
  1292. X */
  1293. X
  1294. Xint
  1295. XParseAddress(str, buf, len)
  1296. Xchar *str;
  1297. Xchar *buf;
  1298. Xint len;
  1299. X{
  1300. X    int i;
  1301. X    int j;
  1302. X    char *base = buf;
  1303. X    char *ParseAddress2();
  1304. X
  1305. X    for (i = j = 0; i < len; ++i) {
  1306. X    if (str[i] == ':') {
  1307. X        buf = ParseAddress2(str + j, buf, i - j);
  1308. X        *buf++ = '!';
  1309. X        j = i + 1;
  1310. X    }
  1311. X    }
  1312. X    buf = ParseAddress2(str + j, buf, i - j);
  1313. X    *buf = 0;
  1314. X    for (i = 0; base[i] && base[i] != '!'; ++i);
  1315. X    return((int)i);
  1316. X}
  1317. X
  1318. X/*
  1319. X *  deals with !, @, and %
  1320. X */
  1321. X
  1322. Xstatic char *
  1323. XParseAddress2(addr, buf, len)
  1324. Xchar *addr;
  1325. Xchar *buf;
  1326. Xint len;
  1327. X{
  1328. X    int i;
  1329. X
  1330. X    for (i = len - 1; i >= 0; --i) {
  1331. X    if (addr[i] == '@' || addr[i] == '%') {
  1332. X        short j = len - i;
  1333. X        strncpy(buf, addr + i + 1, j - 1);
  1334. X        buf += j - 1;
  1335. X        len -= j;
  1336. X        if (len)
  1337. X        *buf++ = '!';
  1338. X    }
  1339. X    }
  1340. X    strncpy(buf, addr, len);
  1341. X    buf += len;
  1342. X    return(buf);
  1343. X}
  1344. X
  1345. X
  1346. END_OF_FILE
  1347. if test 1395 -ne `wc -c <'uucp2/src/sendmail/parse.c'`; then
  1348.     echo shar: \"'uucp2/src/sendmail/parse.c'\" unpacked with wrong size!
  1349. fi
  1350. # end of 'uucp2/src/sendmail/parse.c'
  1351. fi
  1352. if test -f 'uucp2/src/unix/DMakefile' -a "${1}" != "-c" ; then 
  1353.   echo shar: Will not clobber existing file \"'uucp2/src/unix/DMakefile'\"
  1354. else
  1355. echo shar: Extracting \"'uucp2/src/unix/DMakefile'\" \(1123 characters\)
  1356. sed "s/^X//" >'uucp2/src/unix/DMakefile' <<'END_OF_FILE'
  1357. X
  1358. X#   DMakefile
  1359. X#
  1360. X#   $Header: Beta:src/uucp/src/compress/RCS/DMakefile,v 1.1 90/02/02 11:47:54 dillon Exp Locker: dillon $
  1361. X
  1362. XOD=ltmp:uucp/
  1363. XSRCS= compress.c tarsplit.c unshar.c uudecode.c uuencode.c dcron.c
  1364. XOBJS= $(SRCS:"*.c":"$(OD)*.o")
  1365. XSYMS= uucp:src/lib/all.m
  1366. XCFLAGS= -iuucp:src/include/ -cq -v
  1367. XCFLAGS_LD= $(CFLAGS) -b0
  1368. XEXE= uucp:c/
  1369. XLIBS= ltmp:uucp/lib/uucp.lib lib:lc.lib lib:amiga.lib
  1370. X
  1371. XBLINK= blink from lib:cres.o %(right) TO %(left) SC SD LIB $(LIBS)
  1372. XBLINK_LD= blink from lib:c.o %(right) TO %(left) SC LIB $(LIBS)
  1373. X
  1374. Xall: $(EXE)compress $(EXE)tarsplit $(EXE)unshar \
  1375. X     $(EXE)uudecode $(EXE)uuencode $(EXE)dcron
  1376. X
  1377. X$(EXE)compress : $(OD)14compress.o
  1378. X    $(BLINK_LD)
  1379. X
  1380. X$(EXE)dcron : $(OD)dcron.o
  1381. X    $(BLINK)
  1382. X
  1383. X$(EXE)tarsplit : $(OD)tarsplit.o
  1384. X    $(BLINK)
  1385. X
  1386. X$(EXE)unshar : $(OD)unshar.o
  1387. X    $(BLINK)
  1388. X
  1389. X$(EXE)uudecode : $(OD)uudecode.o
  1390. X    $(BLINK)
  1391. X
  1392. X$(EXE)uuencode : $(OD)uuencode.o
  1393. X    $(BLINK)
  1394. X
  1395. X$(OBJS) : $(SRCS)
  1396. X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
  1397. X
  1398. X$(OD)14compress.o : compress.c
  1399. X    lc $(CFLAGS_LD) -H$(SYMS) -o%(left) %(right)
  1400. X
  1401. X$(OD)16compress.o : compress.c
  1402. X    lc $(CFLAGS_LD) -H$(SYMS) -o%(left) %(right)
  1403. X
  1404. END_OF_FILE
  1405. if test 1123 -ne `wc -c <'uucp2/src/unix/DMakefile'`; then
  1406.     echo shar: \"'uucp2/src/unix/DMakefile'\" unpacked with wrong size!
  1407. fi
  1408. # end of 'uucp2/src/unix/DMakefile'
  1409. fi
  1410. if test -f 'uucp2/src/unix/DMakefile.dcc' -a "${1}" != "-c" ; then 
  1411.   echo shar: Will not clobber existing file \"'uucp2/src/unix/DMakefile.dcc'\"
  1412. else
  1413. echo shar: Extracting \"'uucp2/src/unix/DMakefile.dcc'\" \(1091 characters\)
  1414. sed "s/^X//" >'uucp2/src/unix/DMakefile.dcc' <<'END_OF_FILE'
  1415. X
  1416. X#   DMakefile
  1417. X#
  1418. X#   $Header: Beta:src/uucp/src/compress/RCS/DMakefile,v 1.1 90/02/02 11:47:54 dillon Exp Locker: dillon $
  1419. X#
  1420. X#   DCC small-data model note:    library
  1421. X#
  1422. X#   -s includes symbol table
  1423. X
  1424. XOD=dtmp:uucp/
  1425. XSRCS= compress.c tarsplit.c unshar.c uudecode.c uuencode.c dcron.c
  1426. XOBJS= $(SRCS:"*.c":"$(OD)*.o")
  1427. XCFLAGS= -I uucp:src/include/
  1428. XCFLAGS_LD= $(CFLAGS)
  1429. XEXE= uucp:c/
  1430. XLIBS= dtmp:uucp/lib/uucp.lib
  1431. X
  1432. XDLINK= dcc %(right) $(LIBS) -o %(left) -s -r
  1433. XDLINK_LD= dcc %(right) $(LIBS) -o %(left) -s
  1434. X
  1435. X
  1436. Xall: $(EXE)compress $(EXE)tarsplit $(EXE)unshar \
  1437. X     $(EXE)uudecode $(EXE)uuencode $(EXE)dcron
  1438. X
  1439. X$(EXE)compress : $(OD)14compress.o
  1440. X    $(DLINK_LD)
  1441. X
  1442. X$(EXE)dcron : $(OD)dcron.o
  1443. X    $(DLINK)
  1444. X
  1445. X$(EXE)tarsplit : $(OD)tarsplit.o
  1446. X    $(DLINK)
  1447. X
  1448. X$(EXE)unshar : $(OD)unshar.o
  1449. X    $(DLINK)
  1450. X
  1451. X$(EXE)uudecode : $(OD)uudecode.o
  1452. X    $(DLINK)
  1453. X
  1454. X$(EXE)uuencode : $(OD)uuencode.o
  1455. X    $(DLINK)
  1456. X
  1457. X$(OBJS) : $(SRCS)
  1458. X    dcc $(CFLAGS) %(right) -o %(left) -c -r
  1459. X
  1460. X$(OD)14compress.o : compress.c
  1461. X    dcc $(CFLAGS_LD) %(right) -o %(left) -c -mD
  1462. X
  1463. X$(OD)16compress.o : compress.c
  1464. X    dcc $(CFLAGS_LD) %(right) -o %(left) -c -mD
  1465. X
  1466. END_OF_FILE
  1467. if test 1091 -ne `wc -c <'uucp2/src/unix/DMakefile.dcc'`; then
  1468.     echo shar: \"'uucp2/src/unix/DMakefile.dcc'\" unpacked with wrong size!
  1469. fi
  1470. # end of 'uucp2/src/unix/DMakefile.dcc'
  1471. fi
  1472. if test -f 'uucp2/src/unix/uuencode.c' -a "${1}" != "-c" ; then 
  1473.   echo shar: Will not clobber existing file \"'uucp2/src/unix/uuencode.c'\"
  1474. else
  1475. echo shar: Extracting \"'uucp2/src/unix/uuencode.c'\" \(2115 characters\)
  1476. sed "s/^X//" >'uucp2/src/unix/uuencode.c' <<'END_OF_FILE'
  1477. X
  1478. X/*
  1479. X *  UUENCODE.C
  1480. X *
  1481. X *  $Header: Beta:src/uucp/src/compress/RCS/uuencode.c,v 1.1 90/02/02 11:48:04 dillon Exp Locker: dillon $
  1482. X *
  1483. X * uuencode [input] output
  1484. X *
  1485. X * Encode a file so it can be mailed to a remote system.
  1486. X */
  1487. X
  1488. X#include <stdio.h>
  1489. X#include "version.h"
  1490. X
  1491. XIDENT(".00");
  1492. X
  1493. X#ifdef UNIX
  1494. X# include <sys/types.h>
  1495. X# include <sys/stat.h>
  1496. X#endif
  1497. X
  1498. X#ifdef VMS
  1499. X# include <types.h>
  1500. X# include <stat.h>
  1501. X#endif
  1502. X
  1503. X/* ENC is the basic 1 character encoding function to make a char printing */
  1504. X#define ENC(c) (((c) & 077) + ' ')
  1505. X
  1506. Xvoid outdec();
  1507. Xvoid encode();
  1508. Xvoid xerror();
  1509. X
  1510. Xvoid
  1511. Xmain(argc, argv)
  1512. Xchar **argv;
  1513. X{
  1514. X    FILE *in;
  1515. X#ifdef UNIX | VMS
  1516. X    struct stat sbuf;
  1517. X#endif
  1518. X    int mode;
  1519. X
  1520. X    /* optional 1st argument */
  1521. X    if (argc > 2) {
  1522. X        if ((in = fopen(argv[1], "r")) == NULL) {
  1523. X            xerror(argv[1]);
  1524. X            exit(1);
  1525. X        }
  1526. X        argv++; argc--;
  1527. X    } else
  1528. X        in = stdin;
  1529. X
  1530. X    if (argc != 2) {
  1531. X        printf("Usage: uuencode [infile] remotefile\n");
  1532. X        exit(2);
  1533. X    }
  1534. X
  1535. X    /* figure out the input file mode */
  1536. X#ifdef UNIX | VMS
  1537. X    fstat(fileno(in), &sbuf);
  1538. X    mode = sbuf.st_mode & 0777;
  1539. X#endif
  1540. X
  1541. X#ifdef AMIGA
  1542. X    mode = 0777;
  1543. X#endif
  1544. X    printf("begin %o %s\n", mode, argv[1]);
  1545. X
  1546. X    encode(in, stdout);
  1547. X
  1548. X    printf("end\n");
  1549. X    exit(0);
  1550. X}
  1551. X
  1552. X/*
  1553. X * copy from in to out, encoding as you go along.
  1554. X */
  1555. X
  1556. Xvoid
  1557. Xencode(in, out)
  1558. XFILE *in;
  1559. XFILE *out;
  1560. X{
  1561. X    char buf[80];
  1562. X    int i, n;
  1563. X
  1564. X    for (;;) {
  1565. X        /* 1 (up to) 45 character line */
  1566. X        n = fr(in, buf, 45);
  1567. X        putc(ENC(n), out);
  1568. X
  1569. X        for (i=0; i<n; i += 3)
  1570. X            outdec(&buf[i], out);
  1571. X
  1572. X        putc('X', out);
  1573. X        putc('\n', out);
  1574. X
  1575. X        if (n <= 0)
  1576. X            break;
  1577. X    }
  1578. X}
  1579. X
  1580. X/*
  1581. X * output one group of 3 bytes, pointed at by p, on file f.
  1582. X */
  1583. Xvoid
  1584. Xoutdec(p, f)
  1585. Xchar *p;
  1586. XFILE *f;
  1587. X{
  1588. X    int c1, c2, c3, c4;
  1589. X
  1590. X    c1 = *p >> 2;
  1591. X    c2 = (*p << 4) & 060 | (p[1] >> 4) & 017;
  1592. X    c3 = (p[1] << 2) & 074 | (p[2] >> 6) & 03;
  1593. X    c4 = p[2] & 077;
  1594. X    putc(ENC(c1), f);
  1595. X    putc(ENC(c2), f);
  1596. X    putc(ENC(c3), f);
  1597. X    putc(ENC(c4), f);
  1598. X}
  1599. X
  1600. X/* fr: like read but stdio */
  1601. Xint
  1602. Xfr(fd, buf, cnt)
  1603. XFILE *fd;
  1604. Xchar *buf;
  1605. Xint cnt;
  1606. X{
  1607. X    int c, i;
  1608. X
  1609. X    for (i=0; i<cnt; i++) {
  1610. X        c = getc(fd);
  1611. X        if (c == EOF)
  1612. X            return(i);
  1613. X        buf[i] = c;
  1614. X    }
  1615. X    return (cnt);
  1616. X}
  1617. X
  1618. Xvoid
  1619. Xxerror(err)
  1620. Xchar *err;
  1621. X{
  1622. X    printf("Can not open file \"%s\"\n", err);
  1623. X}
  1624. END_OF_FILE
  1625. if test 2115 -ne `wc -c <'uucp2/src/unix/uuencode.c'`; then
  1626.     echo shar: \"'uucp2/src/unix/uuencode.c'\" unpacked with wrong size!
  1627. fi
  1628. # end of 'uucp2/src/unix/uuencode.c'
  1629. fi
  1630. if test -f 'uucp2/src/util/man.c' -a "${1}" != "-c" ; then 
  1631.   echo shar: Will not clobber existing file \"'uucp2/src/util/man.c'\"
  1632. else
  1633. echo shar: Extracting \"'uucp2/src/util/man.c'\" \(1155 characters\)
  1634. sed "s/^X//" >'uucp2/src/util/man.c' <<'END_OF_FILE'
  1635. X
  1636. X/*
  1637. X *  MAN.C
  1638. X *
  1639. X *  $Header: Beta:src/uucp/src/MUtil/RCS/man.c,v 1.3 90/04/03 20:44:52 dillon Exp Locker: dillon $
  1640. X *
  1641. X *  MAN <topic>
  1642. X *
  1643. X *  searches for UUMAN:topic or UUMAN:topic.Doc
  1644. X */
  1645. X
  1646. X#include <stdio.h>
  1647. X#include <stdlib.h>
  1648. X#include "version.h"
  1649. X
  1650. XIDENT(".00");
  1651. X
  1652. Xvoid
  1653. Xmain(ac, av)
  1654. Xchar *av[];
  1655. X{
  1656. X    short i;
  1657. X    static char Buf[256];
  1658. X
  1659. X    for (i = 1; i < ac; ++i) {
  1660. X    char *topic = av[i];
  1661. X
  1662. X    if (Man(topic) == 0) {
  1663. X        char *manDir = MakeConfigPath(UUMAN, "");
  1664. X        sprintf(Buf, "%s%s.Doc", manDir, topic);
  1665. X        if (Man(Buf) == 0) {
  1666. X        sprintf(Buf, "%s%s", manDir, topic);
  1667. X        if (Man(Buf) == 0)
  1668. X            printf("Unable to open %s[.Doc]\n", Buf);
  1669. X        }
  1670. X    }
  1671. X    }
  1672. X}
  1673. X
  1674. XMan(file)
  1675. Xchar *file;
  1676. X{
  1677. X    FILE *fi = fopen(file, "r");
  1678. X    char *filter = FindConfig(RFILTER);
  1679. X    short rb = 1;
  1680. X    static char Cmd[256];
  1681. X
  1682. X    if (fi == NULL)
  1683. X    return(0);
  1684. X    if (filter == NULL) {
  1685. X    if ((filter = FindConfig(FILTER)) == NULL) {
  1686. X        printf("UULIB:Config, no 'Filter' entry\n");
  1687. X        return(0);
  1688. X    }
  1689. X    rb = 0;
  1690. X    }
  1691. X    fclose(fi);
  1692. X    if (rb)
  1693. X    sprintf(Cmd, "Run >nil: <nil: %s %s", filter, file);
  1694. X    else
  1695. X    sprintf(Cmd, "%s %s", filter, file);
  1696. X    Execute(Cmd, NULL, NULL);
  1697. X}
  1698. X
  1699. END_OF_FILE
  1700. if test 1155 -ne `wc -c <'uucp2/src/util/man.c'`; then
  1701.     echo shar: \"'uucp2/src/util/man.c'\" unpacked with wrong size!
  1702. fi
  1703. # end of 'uucp2/src/util/man.c'
  1704. fi
  1705. if test -f 'uucp2/src/util/trimfile.c' -a "${1}" != "-c" ; then 
  1706.   echo shar: Will not clobber existing file \"'uucp2/src/util/trimfile.c'\"
  1707. else
  1708. echo shar: Extracting \"'uucp2/src/util/trimfile.c'\" \(2057 characters\)
  1709. sed "s/^X//" >'uucp2/src/util/trimfile.c' <<'END_OF_FILE'
  1710. X
  1711. X/*
  1712. X *  TRIMFILE file1 file2 .. filen -lines
  1713. X *
  1714. X *  $Header: Beta:src/uucp/src/MUtil/RCS/trimfile.c,v 1.1 90/02/02 12:12:01 dillon Exp Locker: dillon $
  1715. X *
  1716. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1717. X *
  1718. X *  Trims the specified files to the specified number of lines.  Each
  1719. X *  file is read and the last N lines written back.
  1720. X *
  1721. X *  Normally used to trim log files based on a crontab entry.  If no
  1722. X *  -lines argument is given the file is trimmed to 100 lines.
  1723. X *
  1724. X *  Each line may be up to 255 characters in length.
  1725. X */
  1726. X
  1727. X#include <stdio.h>
  1728. X#include <stdlib.h>
  1729. X#include "version.h"
  1730. X
  1731. XIDENT(".00");
  1732. X
  1733. X#define LINSIZE 256
  1734. X
  1735. Xchar    **LineBuf;
  1736. Xlong    Lines = 100;
  1737. X
  1738. XLocal void  MemErr(void);
  1739. XLocal void  TrimFile(char *);
  1740. X
  1741. Xmain(ac, av)
  1742. Xchar *av[];
  1743. X{
  1744. X    short i;
  1745. X    for (i = 1; i < ac; ++i) {
  1746. X    if (av[i][0] == '-')
  1747. X        Lines = atol(av[i] + 1);
  1748. X    }
  1749. X    if (Lines < 0) {
  1750. X    fprintf(stderr, "Illegal line specification %d\n", Lines);
  1751. X    exit(1);
  1752. X    }
  1753. X
  1754. X    /*
  1755. X     *    Allocating one more than necessary handles the Lines == 0 case
  1756. X     *    as well as supplying a scratch buffer for the last fgets that
  1757. X     *    fails.
  1758. X     */
  1759. X
  1760. X    LineBuf = malloc(sizeof(char *) * (Lines + 1));
  1761. X    if (LineBuf == NULL)
  1762. X    MemErr();
  1763. X    for (i = 0; i <= Lines; ++i) {
  1764. X    LineBuf[i] = malloc(LINSIZE);
  1765. X    if (LineBuf[i] == NULL)
  1766. X        MemErr();
  1767. X    }
  1768. X    for (i = 1; i < ac; ++i) {
  1769. X    char *ptr = av[i];
  1770. X
  1771. X    if (*ptr == '-')
  1772. X        continue;
  1773. X    LockFile("LOG-UPDATE");     /*  see lib/log.c   */
  1774. X    TrimFile(ptr);
  1775. X    UnLockFile("LOG-UPDATE");
  1776. X    }
  1777. X    return(0);
  1778. X}
  1779. X
  1780. Xvoid
  1781. XMemErr()
  1782. X{
  1783. X    fprintf(stderr, "Not enough memory!\n");
  1784. X    exit(1);
  1785. X}
  1786. X
  1787. Xvoid
  1788. XTrimFile(name)
  1789. Xchar *name;
  1790. X{
  1791. X    FILE *fi = fopen(name, "r");
  1792. X    long rep;
  1793. X    long i;
  1794. X
  1795. X    if (fi == NULL)
  1796. X    return;
  1797. X
  1798. X    i = 0;
  1799. X    rep = 0;
  1800. X    while (fgets(LineBuf[i], LINSIZE, fi)) {
  1801. X    if (++i > Lines) {
  1802. X        i = 0;
  1803. X        rep = 1;
  1804. X    }
  1805. X    }
  1806. X    fclose(fi);
  1807. X
  1808. X    if (rep == 0)
  1809. X    return;
  1810. X
  1811. X    if (fi = fopen(name, "w")) {
  1812. X    long j;
  1813. X    for (j = Lines; j; --j) {
  1814. X        if (++i > Lines)
  1815. X        i = 0;
  1816. X        fputs(LineBuf[i], fi);
  1817. X    }
  1818. X    fclose(fi);
  1819. X    }
  1820. X}
  1821. X
  1822. END_OF_FILE
  1823. if test 2057 -ne `wc -c <'uucp2/src/util/trimfile.c'`; then
  1824.     echo shar: \"'uucp2/src/util/trimfile.c'\" unpacked with wrong size!
  1825. fi
  1826. # end of 'uucp2/src/util/trimfile.c'
  1827. fi
  1828. if test -f 'uucp2/src/util/trimnews.c' -a "${1}" != "-c" ; then 
  1829.   echo shar: Will not clobber existing file \"'uucp2/src/util/trimnews.c'\"
  1830. else
  1831. echo shar: Extracting \"'uucp2/src/util/trimnews.c'\" \(2042 characters\)
  1832. sed "s/^X//" >'uucp2/src/util/trimnews.c' <<'END_OF_FILE'
  1833. X
  1834. X/*
  1835. X *  TRIMNEWS.C
  1836. X *
  1837. X *  TRIMNEWS
  1838. X *
  1839. X *  This program scans UULIB:NewsGroups then chdir's into each news group's
  1840. X *  directory.    The second field specifies the number of days old any numerical
  1841. X *  file (ifilename beginning with 0-9) is allowed to be before it is deleted.
  1842. X *
  1843. X *  If the second field does not exist for a given line in the NewsGroups file,
  1844. X *  7 days is automatically assumed.  The number of days is referenced from
  1845. X *  when the file was created, NOT the Date: field in the article.
  1846. X *
  1847. X *  The program is meant to be run daily from a DCron entry to clear out old
  1848. X *  news.
  1849. X */
  1850. X
  1851. X#include <stdio.h>
  1852. X#include <stdlib.h>
  1853. X#include "config.h"
  1854. X#include "version.h"
  1855. X#include <libraries/dos.h>
  1856. X
  1857. Xtypedef struct FileInfoBlock    FIB;
  1858. X
  1859. XIDENT(".01");
  1860. X
  1861. Xstatic char TmpBuf[256];
  1862. X
  1863. Xvoid ScanDirectoryDeleteFiles();
  1864. X
  1865. Xint
  1866. Xbrk()
  1867. X{
  1868. X    return(0);
  1869. X}
  1870. X
  1871. Xmain(ac, av)
  1872. Xchar *av[];
  1873. X{
  1874. X    FILE *fi;
  1875. X    char *path;
  1876. X    char newsgrp[64];
  1877. X    int days;
  1878. X
  1879. X    onbreak(brk);
  1880. X    fi = openlib("NewsGroups");
  1881. X    if (fi == NULL) {
  1882. X    puts("Unable to open NewsGroups file");
  1883. X    exit(1);
  1884. X    }
  1885. X    while (fgets(TmpBuf, sizeof(TmpBuf), fi)) {
  1886. X    switch (sscanf(TmpBuf, "%s %d", newsgrp, &days)) {
  1887. X    case 1:
  1888. X        days = 7;
  1889. X    case 2:
  1890. X        path = MakeConfigPath(UUNEWS, newsgrp);
  1891. X        if (days)
  1892. X        ScanDirectoryDeleteFiles(path, days);
  1893. X    }
  1894. X    }
  1895. X    fclose(fi);
  1896. X    return(0);
  1897. X}
  1898. X
  1899. Xvoid
  1900. XScanDirectoryDeleteFiles(path, days)
  1901. Xchar *path;
  1902. Xint days;
  1903. X{
  1904. X    BPTR lock;
  1905. X    BPTR oldlock;
  1906. X    FIB *fib;
  1907. X    long ds[3];
  1908. X    long tnow;
  1909. X
  1910. X    DateStamp(ds);
  1911. X    tnow = dstot(ds) - days * 1440*60;
  1912. X
  1913. X    if (lock = Lock(path, ACCESS_READ)) {
  1914. X    oldlock = CurrentDir(lock);
  1915. X    if (fib = malloc(sizeof(FIB))) {
  1916. X        if (Examine(lock, fib)) {
  1917. X        while (ExNext(lock, fib)) {
  1918. X            if (isdigit((unsigned char)fib->fib_FileName[0])) {
  1919. X            if (tnow > dstot(&fib->fib_Date))
  1920. X                DeleteFile(fib->fib_FileName);
  1921. X            }
  1922. X        }
  1923. X        }
  1924. X        free(fib);
  1925. X    }
  1926. X    UnLock(CurrentDir(oldlock));
  1927. X    }
  1928. X}
  1929. X
  1930. Xlong
  1931. Xdstot(date)
  1932. Xlong *date;    /*  days, mins, ticks    */
  1933. X{
  1934. X    return(date[0] * 1440 * 60 + date[1] * 60 + date[2] / 50);
  1935. X}
  1936. X
  1937. END_OF_FILE
  1938. if test 2042 -ne `wc -c <'uucp2/src/util/trimnews.c'`; then
  1939.     echo shar: \"'uucp2/src/util/trimnews.c'\" unpacked with wrong size!
  1940. fi
  1941. # end of 'uucp2/src/util/trimnews.c'
  1942. fi
  1943. if test -f 'uucp2/src/uucico/DMakefile' -a "${1}" != "-c" ; then 
  1944.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/DMakefile'\"
  1945. else
  1946. echo shar: Extracting \"'uucp2/src/uucico/DMakefile'\" \(1339 characters\)
  1947. sed "s/^X//" >'uucp2/src/uucico/DMakefile' <<'END_OF_FILE'
  1948. X
  1949. X#   DMakefile
  1950. X#
  1951. X#   $Header: Beta:src/uucp/src/uucico/RCS/DMakefile,v 1.1 90/02/02 11:57:52 dillon Exp $
  1952. X#
  1953. X#   Note: uucico_protos.h is program-generated from 'Prototype' lines
  1954. X#      in individual source files.
  1955. X
  1956. XOD=ltmp:uucp/
  1957. XEXE= uucp:c/
  1958. XSYMS= uucp:src/lib/all.m
  1959. XPROTOS= uucp:src/include/uucico_protos.h
  1960. XMAKEPROTO= $(OD)lib/makeproto
  1961. X
  1962. XCFLAGS= -iuucp:src/include/ -iuucp:src/ -cq
  1963. X
  1964. XLOPTS= SC SD LIB ltmp:uucp/lib/uucp.lib lib:lc.lib lib:amiga.lib
  1965. X
  1966. XSRCS=gio.c sysdep.c uucp.c uupoll.c uuxqt.c modem.c uucico.c \
  1967. X    uuhosts.c uuname.c uux.c time.c
  1968. X
  1969. XOBJS=$(SRCS:"*.c":"$(OD)*.o")
  1970. X
  1971. Xall:    $(PROTOS) $(EXE)uucico $(EXE)uuxqt $(EXE)uupoll \
  1972. X    $(EXE)uux $(EXE)uuname $(EXE)uucp
  1973. X
  1974. X$(EXE)uucico: $(OD)gio.o $(OD)sysdep.o $(OD)modem.o $(OD)uucico.o $(OD)time.o
  1975. X    blink FROM lib:cres.o %(right) ADDSYM $(LOPTS) TO %(left)
  1976. X
  1977. X$(EXE)uuxqt: $(OD)uuxqt.o
  1978. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  1979. X
  1980. X$(EXE)uupoll: $(OD)uupoll.o
  1981. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  1982. X
  1983. X$(EXE)uux: $(OD)uux.o
  1984. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  1985. X
  1986. X$(EXE)uuname: $(OD)uuname.o
  1987. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  1988. X
  1989. X$(EXE)uucp: $(OD)uucp.o
  1990. X    blink FROM lib:cres.o %(right) $(LOPTS) TO %(left)
  1991. X
  1992. X$(OBJS) : $(SRCS)
  1993. X    lc $(CFLAGS) -H$(SYMS) -o%(left) %(right)
  1994. X
  1995. X$(PROTOS) : $(SRCS)
  1996. X    $(MAKEPROTO) -o%(left) %(right)
  1997. X
  1998. END_OF_FILE
  1999. if test 1339 -ne `wc -c <'uucp2/src/uucico/DMakefile'`; then
  2000.     echo shar: \"'uucp2/src/uucico/DMakefile'\" unpacked with wrong size!
  2001. fi
  2002. # end of 'uucp2/src/uucico/DMakefile'
  2003. fi
  2004. if test -f 'uucp2/src/uucico/DMakefile.dcc' -a "${1}" != "-c" ; then 
  2005.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/DMakefile.dcc'\"
  2006. else
  2007. echo shar: Extracting \"'uucp2/src/uucico/DMakefile.dcc'\" \(1196 characters\)
  2008. sed "s/^X//" >'uucp2/src/uucico/DMakefile.dcc' <<'END_OF_FILE'
  2009. X
  2010. X#   DMakefile
  2011. X#
  2012. X#   $Header: Beta:src/uucp/src/uucico/RCS/DMakefile,v 1.1 90/02/02 11:57:52 dillon Exp $
  2013. X#
  2014. X#   Note: uucico_protos.h is program-generated from 'Prototype' lines
  2015. X#      in individual source files.
  2016. X
  2017. XOD=dtmp:uucp/
  2018. XEXE= uucp:c/
  2019. XPROTOS= uucp:src/include/uucico_protos.h
  2020. XMAKEPROTO= $(OD)lib/makeproto
  2021. X
  2022. XCFLAGS= -I uucp:src/include/ -I uucp:src/
  2023. X
  2024. XLOPTS= dtmp:uucp/lib/uucp.lib
  2025. X
  2026. XSRCS=gio.c sysdep.c uucp.c uupoll.c uuxqt.c modem.c uucico.c \
  2027. X    uuhosts.c uuname.c uux.c time.c
  2028. X
  2029. XOBJS=$(SRCS:"*.c":"$(OD)*.o")
  2030. X
  2031. Xall:    $(PROTOS) $(EXE)uucico $(EXE)uuxqt $(EXE)uupoll \
  2032. X    $(EXE)uux $(EXE)uuname $(EXE)uucp
  2033. X
  2034. X$(EXE)uucico: $(OD)gio.o $(OD)sysdep.o $(OD)modem.o $(OD)uucico.o $(OD)time.o
  2035. X    dcc %(right) $(LOPTS) -o %(left) -s -r
  2036. X
  2037. X$(EXE)uuxqt: $(OD)uuxqt.o
  2038. X    dcc %(right) $(LOPTS) -o %(left) -s -r
  2039. X
  2040. X$(EXE)uupoll: $(OD)uupoll.o
  2041. X    dcc %(right) $(LOPTS) -o %(left) -s -r
  2042. X
  2043. X$(EXE)uux: $(OD)uux.o
  2044. X    dcc %(right) $(LOPTS) -o %(left) -s -r
  2045. X
  2046. X$(EXE)uuname: $(OD)uuname.o
  2047. X    dcc %(right) $(LOPTS) -o %(left) -s -r
  2048. X
  2049. X$(EXE)uucp: $(OD)uucp.o
  2050. X    dcc %(right) $(LOPTS) -o %(left) -s -r
  2051. X
  2052. X$(OBJS) : $(SRCS)
  2053. X    dcc $(CFLAGS) %(right) -o %(left) -r -c
  2054. X
  2055. X$(PROTOS) : $(SRCS)
  2056. X    $(MAKEPROTO) -o%(left) %(right)
  2057. X
  2058. END_OF_FILE
  2059. if test 1196 -ne `wc -c <'uucp2/src/uucico/DMakefile.dcc'`; then
  2060.     echo shar: \"'uucp2/src/uucico/DMakefile.dcc'\" unpacked with wrong size!
  2061. fi
  2062. # end of 'uucp2/src/uucico/DMakefile.dcc'
  2063. fi
  2064. if test -f 'uucp2/src/uucico/gio.notes' -a "${1}" != "-c" ; then 
  2065.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/gio.notes'\"
  2066. else
  2067. echo shar: Extracting \"'uucp2/src/uucico/gio.notes'\" \(2029 characters\)
  2068. sed "s/^X//" >'uucp2/src/uucico/gio.notes' <<'END_OF_FILE'
  2069. XThis documents describes changes I made to gio.c to support a larger
  2070. Xwindow size.
  2071. X
  2072. XDocumentation of the "g" protocol is sparse.  The information I have
  2073. Xcomes from various "public" implementations of UUCICO.  AmigaUUCP is
  2074. Xthe only one which supports a window greater than one. The PCMAIL2
  2075. Xsystem, distributed recently in comp.sources.misc, has fairly good
  2076. Xdocumentation of "g" included in its source, but it only supports a
  2077. Xwindow size of 1.
  2078. X
  2079. XWINDOWSIZE:
  2080. X    This was changed to 7.  Unix systems are shipped with a maximum
  2081. Xwindow size of 3, although there are patches for various systems to
  2082. Xincrease it to 7.
  2083. X
  2084. XRxSeq:
  2085. X    RxSeq was changed to reflect the last valid packet received.
  2086. XThis simplified the code in several places.
  2087. X
  2088. XGetTxBuf():
  2089. X    This function was changed to dynamically allocate up to 8
  2090. Xbuffers, allowing window sizes up to 7.  The old code should work with
  2091. Xwindow sizes up to 3.
  2092. X
  2093. XGetData():
  2094. X    The acknowledged sequence numbers from the receiver during
  2095. Xtransmits are expected to be in the range ((TxSeq - TxPend) & 7) to
  2096. XTxSeq.  Acknowledging ((TxSeq - TxPend) & 7), the packet immediately
  2097. Xpreceding the first packet in the current window, implies that none of
  2098. Xthe packets in the current window have been received.  My mail
  2099. Xconnection, a 286 based Unix-PC, handles this circumstance by sending
  2100. XRR packet after each timeout.  Previously, the protocol would loop
  2101. Xindefinitely in this case.  I fixed the code to treat a repeated RR
  2102. Xacknowledgement as a rejection.
  2103. X    When a packet gets rejected, the entire window following the
  2104. Xpacket must be retransmitted as well, since the receiver does not
  2105. Xhandle packets out of sequence.  In the rejection code, the entire
  2106. Xwindow is resent without checking for acknowledgements.
  2107. X    I eliminated a window size dependent test in the code for
  2108. Xhandling data packet reception.  I have never seen the code exercised,
  2109. Xbut the change only allows extra RJ packets to be sent.
  2110. X
  2111. XRecvdAck():
  2112. X    Some simplification of the code.  Also, I eliminated the message
  2113. Xwhich occured when a packet was re-acknowledged.
  2114. END_OF_FILE
  2115. if test 2029 -ne `wc -c <'uucp2/src/uucico/gio.notes'`; then
  2116.     echo shar: \"'uucp2/src/uucico/gio.notes'\" unpacked with wrong size!
  2117. fi
  2118. # end of 'uucp2/src/uucico/gio.notes'
  2119. fi
  2120. if test -f 'uucp2/src/uucico/sysdep.h' -a "${1}" != "-c" ; then 
  2121.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/sysdep.h'\"
  2122. else
  2123. echo shar: Extracting \"'uucp2/src/uucico/sysdep.h'\" \(1995 characters\)
  2124. sed "s/^X//" >'uucp2/src/uucico/sysdep.h' <<'END_OF_FILE'
  2125. X
  2126. X/*
  2127. X *  SYSDEP.H
  2128. X *
  2129. X *  $Header: Beta:src/uucp/src/uucico/RCS/sysdep.h,v 1.1 90/02/02 11:55:55 dillon Exp Locker: dillon $
  2130. X *
  2131. X * Amiga Port by William Loftus
  2132. X * Changes are Copyright 1988 by William Loftus. All rights reserved.
  2133. X *
  2134. X * Declarations of gnuucp's system-dependent routines, which
  2135. X * are in the file sysdep.c (a link to one of many system dependent
  2136. X * implementations).
  2137. X */
  2138. X
  2139. Xvoid    munge_filename();
  2140. X
  2141. X/*
  2142. X * Basement level I/O routines
  2143. X *
  2144. X * xwrite() writes a character string to the serial port
  2145. X * xgetc() returns a character from the serial port, or an EOF for timeout.
  2146. X * sigint() restores the state of the serial port on exit.
  2147. X * openline() opens a serial port for an incoming call, waiting for carrier.
  2148. X * openout() opens a serial port for an outgoing call.
  2149. X */
  2150. Xint xwrite();           /* filedesc, buffer, count */
  2151. Xint xgetc();            /* No arg */
  2152. Xint sigint();          /* No arg */
  2153. Xvoid openline();        /* ttyname */
  2154. Xint openout();          /* ttyname */
  2155. Xvoid amiga_setup();     /* No arg */
  2156. X
  2157. X
  2158. X/*
  2159. X * Uucp work queue scan.
  2160. X *
  2161. X * gotsome = work_scan(hostname);
  2162. X *
  2163. X * Result is 1 if there is work, 0 if none.  If result is 1, and work_scan
  2164. X * is called a second time without an intervening work_done, it won't
  2165. X * rescan the directory but simply returns a 1.
  2166. X *
  2167. X * workfile = work_next();
  2168. X *
  2169. X * Result is char * to static filename; or NULL if no more.
  2170. X * We only read the directory once.  If callers want more to rescan it
  2171. X * in case more work is here, they should call work_scan again.
  2172. X *
  2173. X * void work_done();
  2174. X * Clean up a work scan.  No need to call this if work_next returned NULL;
  2175. X * it has cleaned up.
  2176. X */
  2177. Xextern int work_scan();
  2178. Xextern char *work_next();
  2179. Xextern void work_done();
  2180. X
  2181. X/* SERIAL PORT DELARATIONS ALSO TIMER */
  2182. Xextern struct MsgPort *CreatePort();
  2183. Xextern struct IOExtSer *Read_Request;
  2184. Xextern unsigned char rs_in[2];
  2185. Xextern struct IOExtSer *Write_Request;
  2186. Xextern unsigned char rs_out[2];
  2187. Xextern struct timerequest Timer;
  2188. Xextern struct MsgPort *Timer_Port;
  2189. X
  2190. X
  2191. END_OF_FILE
  2192. if test 1995 -ne `wc -c <'uucp2/src/uucico/sysdep.h'`; then
  2193.     echo shar: \"'uucp2/src/uucico/sysdep.h'\" unpacked with wrong size!
  2194. fi
  2195. # end of 'uucp2/src/uucico/sysdep.h'
  2196. fi
  2197. if test -f 'uucp2/src/uucico/time.c' -a "${1}" != "-c" ; then 
  2198.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/time.c'\"
  2199. else
  2200. echo shar: Extracting \"'uucp2/src/uucico/time.c'\" \(1987 characters\)
  2201. sed "s/^X//" >'uucp2/src/uucico/time.c' <<'END_OF_FILE'
  2202. X
  2203. X/*
  2204. X *  TIME.C
  2205. X *
  2206. X *  By Christopher A. Wichura
  2207. X *
  2208. X *  Note: cannot use strtok() due to parent level's use of it.
  2209. X */
  2210. X
  2211. X#include "includes.h"           /* System include files, system dependent */
  2212. X#include "uucp.h"               /* Uucp definitions and parameters */
  2213. X#include <log.h>
  2214. X#include "version.h"
  2215. X
  2216. Xtypedef struct tm   Time;
  2217. X
  2218. Xchar Days[7][3] = {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"};
  2219. X
  2220. Xint
  2221. XCheckTimeRestrictions(timeStr)
  2222. Xchar *timeStr;
  2223. X{
  2224. X    Time *tm;
  2225. X    char *ptr;
  2226. X    int work1;
  2227. X    int work2;
  2228. X    int starth, startm;
  2229. X    int endh,    endm;
  2230. X    char Hours[24];
  2231. X    int result;
  2232. X    int day;
  2233. X
  2234. X    if (strnicmp("Any", timeStr, 3) == 0)
  2235. X    return (SUCCESS);
  2236. X
  2237. X    if (strnicmp("Never", timeStr, 5) == 0)
  2238. X    return (FAIL);
  2239. X
  2240. X    {
  2241. X    time_t t;
  2242. X    time (&t);
  2243. X    tm = localtime(&t);
  2244. X    }
  2245. X
  2246. X    result = FAIL;
  2247. X
  2248. X    for (ptr = timeStr; ptr; ptr = strpbrk(ptr, ",")) {
  2249. X    if (*ptr == ',')
  2250. X        ++ptr;
  2251. X
  2252. X    day = 0;
  2253. X
  2254. X    while (isalpha(*ptr)) {
  2255. X        for (work1 = 0; work1 < 7; ++work1) {
  2256. X        if (strnicmp(ptr, Days[work1], 2) == 0) {
  2257. X            day |= 1L << work1;
  2258. X            ptr += 2;
  2259. X            break;
  2260. X        }
  2261. X        }
  2262. X        if (work1 == 7) {
  2263. X        ulog(-1, "Illegal DOW Field (L.Sys): %s", timeStr);
  2264. X        return(FAIL);
  2265. X        }
  2266. X    }
  2267. X
  2268. X    if (day == 0)
  2269. X        day = -1;
  2270. X
  2271. X    if (sscanf(ptr, "%d:%d-%d:%d", &starth, &startm, &endh, &endm) != 4) {
  2272. X        ulog(-1, "Illegal Time Range Field (L.Sys): %s", timeStr);
  2273. X        return(FAIL);
  2274. X    }
  2275. X
  2276. X    /*
  2277. X     * at this point we have start and end times.  check them against
  2278. X     * current system time
  2279. X     */
  2280. X
  2281. X    setmem(Hours, sizeof(Hours), 0);
  2282. X
  2283. X    work1 = endh - starth;
  2284. X    if (work1 < 0)
  2285. X        work1 += 24;
  2286. X
  2287. X    work1 = starth + work1;
  2288. X    work2 = starth;
  2289. X
  2290. X    while (work2 <= work1) {
  2291. X        Hours[work2++] = 1;
  2292. X
  2293. X        if (work2 == 24)
  2294. X        work1 -= 24, work2 -=24;
  2295. X    }
  2296. X
  2297. X    for (;;) {
  2298. X        if (!(day & 1L << tm->tm_wday))
  2299. X        break;
  2300. X        if (!Hours[tm->tm_hour])
  2301. X        break;
  2302. X        if (tm->tm_hour == starth && tm->tm_min < startm)
  2303. X        break;
  2304. X        if (tm->tm_hour == endh && tm->tm_min > endm)
  2305. X        break;
  2306. X        return(SUCCESS);
  2307. X    }
  2308. X    }
  2309. X    return (FAIL);
  2310. X}
  2311. X
  2312. END_OF_FILE
  2313. if test 1987 -ne `wc -c <'uucp2/src/uucico/time.c'`; then
  2314.     echo shar: \"'uucp2/src/uucico/time.c'\" unpacked with wrong size!
  2315. fi
  2316. # end of 'uucp2/src/uucico/time.c'
  2317. fi
  2318. if test -f 'uucp2/src/uucico/uucp.h' -a "${1}" != "-c" ; then 
  2319.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/uucp.h'\"
  2320. else
  2321. echo shar: Extracting \"'uucp2/src/uucico/uucp.h'\" \(1405 characters\)
  2322. sed "s/^X//" >'uucp2/src/uucico/uucp.h' <<'END_OF_FILE'
  2323. X/*
  2324. X *  UUCP.H
  2325. X *
  2326. X *  $Header: Beta:src/uucp/src/uucico/RCS/uucp.h,v 1.1 90/02/02 11:56:18 dillon Exp Locker: dillon $
  2327. X *
  2328. X * Header file for gnuucp.
  2329. X *
  2330. X * Pieces that look like they might be taken from Unix uucp are
  2331. X * cribbed with the aid of public domain uucp modules (like the F-protocol)
  2332. X * that use that interface.
  2333. X *
  2334. X * Ported to Amiga by William Loftus
  2335. X * Changes Copyright 1988 by William Loftus.  All rights reserved.
  2336. X */
  2337. X
  2338. X#define Ifn    FOO    /* file descriptor of the "phone line" */
  2339. X
  2340. X#define ASSERT(cond, msg, moremsg, huh) /**/
  2341. X
  2342. X/* I may have these flipped from what Unix uses... */
  2343. X/* BUT: my code depends on these values in if (foo()) statements, sigh */
  2344. X#define SUCCESS 0
  2345. X#define FAIL    1
  2346. X
  2347. X#define LOG
  2348. X
  2349. X#define MAXMSGLEN    ((NAMESIZE*4)+SLOP)     /* ?>?? FIXME */
  2350. X#define MAXMSGTIME    60    /* Timeout period for rdmsg */
  2351. X#define MAX_HOST    20    /* Host name length (uucp does 7) */
  2352. X#define MAX_LSYS    500    /* Max length of an L.sys line in chars */
  2353. X#define MAX_CTLLINE    100    /* Max length of a usenet.ctl line */
  2354. X
  2355. X#define CTL_DELIM    " \t\n\r"       /* Delimiters for usenet.ctl */
  2356. X
  2357. Xextern int debug;        /* Debugging level */
  2358. X
  2359. X/*
  2360. X * Timeout for raw characters -- if we don't hear a char within BYTE_TIMEOUT
  2361. X * seconds, we assume the other side has gone away.  Has nothing to do with
  2362. X * retransmission timeouts (if any!).
  2363. X */
  2364. X#define BYTE_TIMEOUT    40
  2365. X#define BYTE_TO     40
  2366. X
  2367. X#define SLOP        10        /* Slop space on arrays */
  2368. X
  2369. END_OF_FILE
  2370. if test 1405 -ne `wc -c <'uucp2/src/uucico/uucp.h'`; then
  2371.     echo shar: \"'uucp2/src/uucico/uucp.h'\" unpacked with wrong size!
  2372. fi
  2373. # end of 'uucp2/src/uucico/uucp.h'
  2374. fi
  2375. if test -f 'uucp2/src/uucico/uupoll.c' -a "${1}" != "-c" ; then 
  2376.   echo shar: Will not clobber existing file \"'uucp2/src/uucico/uupoll.c'\"
  2377. else
  2378. echo shar: Extracting \"'uucp2/src/uucico/uupoll.c'\" \(1088 characters\)
  2379. sed "s/^X//" >'uucp2/src/uucico/uupoll.c' <<'END_OF_FILE'
  2380. X
  2381. X/*
  2382. X * UUPOLL  -- call a UUCP connect site
  2383. X *
  2384. X *  $Header: Beta:src/uucp/src/uucico/RCS/uupoll.c,v 1.1 90/02/02 11:56:15 dillon Exp Locker: dillon $
  2385. X *
  2386. X * Usage: UUPOLL <system-name>
  2387. X *
  2388. X * Copyright 1988 by William Loftus.  All rights reserved.
  2389. X *
  2390. X * ARPA: wpl@prc.unisys.com
  2391. X * UUCP: wpl@burdvax.UUCP
  2392. X * USMAIL: Unisys/Paoli Research Center;PO BOX 517;Paoli, PA 19301-0517
  2393. X *
  2394. X */
  2395. X
  2396. X#include <stdio.h>
  2397. X#include <stdlib.h>
  2398. X#include <string.h>
  2399. X#include "version.h"
  2400. X
  2401. X#define LOCK_FILE "t:UUCP.LCK"
  2402. X
  2403. X#define TRUE 1
  2404. X#define FALSE 0
  2405. X
  2406. XIDENT(".03");
  2407. X
  2408. XCXBRK()
  2409. X{
  2410. X    return(0);
  2411. X}
  2412. X
  2413. Xvoid
  2414. Xmain (argc, argv)
  2415. Xint argc;
  2416. Xchar ** argv;
  2417. X{
  2418. X  static  char buf[256];
  2419. X
  2420. X  if (argc != 2) {
  2421. X     printf("Usage: UUPOLL <system-name>\n");
  2422. X     exit(1);
  2423. X  }
  2424. X
  2425. X  if (access(LOCK_FILE,0) != -1) {
  2426. X     printf("UUCP is locked.\n");
  2427. X     exit(0);
  2428. X  }
  2429. X
  2430. X    if (is_in_L_sys_file(argv[1])) {
  2431. X    sprintf(buf, "run >nil: <nil: UUCICO -s%s\n", argv[1]);
  2432. X    if (system(buf) == -1) {
  2433. X        printf("Error spawning task to call system \"%s\"\n", argv[1]);
  2434. X    }
  2435. X    } else {
  2436. X    printf("System \"%s\" not in L.sys file.\n", argv[1]);
  2437. X    }
  2438. X}
  2439. X
  2440. X
  2441. END_OF_FILE
  2442. if test 1088 -ne `wc -c <'uucp2/src/uucico/uupoll.c'`; then
  2443.     echo shar: \"'uucp2/src/uucico/uupoll.c'\" unpacked with wrong size!
  2444. fi
  2445. # end of 'uucp2/src/uucico/uupoll.c'
  2446. fi
  2447. if test -f 'uucp2/src/uuser/misc.c' -a "${1}" != "-c" ; then 
  2448.   echo shar: Will not clobber existing file \"'uucp2/src/uuser/misc.c'\"
  2449. else
  2450. echo shar: Extracting \"'uucp2/src/uuser/misc.c'\" \(1980 characters\)
  2451. sed "s/^X//" >'uucp2/src/uuser/misc.c' <<'END_OF_FILE'
  2452. X
  2453. X/*
  2454. X *  MISC.C  - support routines - Phillip Lindsay (C) Commodore 1986
  2455. X *  You may freely distribute this source and use it for Amiga Development -
  2456. X *  as long as the Copyright notice is left intact.
  2457. X *
  2458. X *  $Header: Beta:src/uucp/src/uuser/RCS/misc.c,v 1.1 90/02/02 12:10:13 dillon Exp Locker: dillon $
  2459. X *
  2460. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  2461. X *
  2462. X * 30-SEP-86
  2463. X *
  2464. X *  major modifications by Matthew Dillon for my PIPE: and other devices,
  2465. X *  but basic theorem still Phil's.
  2466. X */
  2467. X
  2468. X#include <exec/types.h>
  2469. X#include <exec/nodes.h>
  2470. X#include <exec/lists.h>
  2471. X#include <exec/ports.h>
  2472. X#include <libraries/dos.h>
  2473. X#include <libraries/dosextens.h>
  2474. X#include "protos.h"
  2475. X
  2476. Xtypedef struct Node NODE;
  2477. X
  2478. Xextern void returnpkt();
  2479. X
  2480. Xvoid
  2481. Xreturnpktplain(packet, myproc)
  2482. Xstruct DosPacket *packet;
  2483. Xstruct Process *myproc;
  2484. X{
  2485. X    returnpkt(packet, myproc, packet->dp_Res1, packet->dp_Res2);
  2486. X}
  2487. X
  2488. X
  2489. Xvoid
  2490. Xreturnpkt(packet, myproc, res1, res2)
  2491. Xregister struct DosPacket *packet;
  2492. Xstruct Process *myproc;
  2493. Xlong res1, res2;
  2494. X{
  2495. X    struct Message *mess;
  2496. X    struct MsgPort *replyport;
  2497. X
  2498. X    packet->dp_Res1         = res1;
  2499. X    packet->dp_Res2         = res2;
  2500. X    replyport             = packet->dp_Port;
  2501. X    mess             = packet->dp_Link;
  2502. X    packet->dp_Port         = &myproc->pr_MsgPort;
  2503. X    mess->mn_Node.ln_Name    = (char *)packet;
  2504. X    mess->mn_Node.ln_Succ    = NULL;
  2505. X    mess->mn_Node.ln_Pred    = NULL;
  2506. X    PutMsg(replyport, mess);
  2507. X}
  2508. X
  2509. X
  2510. X/*
  2511. X * taskwait() ... Waits for a message to arrive at your port and
  2512. X *   extracts the packet address which is returned to you.
  2513. X */
  2514. X
  2515. Xstruct DosPacket *
  2516. Xtaskwait(myproc)
  2517. Xstruct Process *myproc;
  2518. X{
  2519. X    struct MsgPort *myport;
  2520. X    struct Message *mymess;
  2521. X
  2522. X    myport = &myproc->pr_MsgPort;
  2523. X    WaitPort(myport);
  2524. X    mymess = (struct Message *)GetMsg(myport);
  2525. X    return((struct DosPacket *)mymess->mn_Node.ln_Name);
  2526. X}
  2527. X
  2528. Xtaskpktrdy(myproc)
  2529. Xstruct Process *myproc;
  2530. X{
  2531. X    if (((NODE *)myproc->pr_MsgPort.mp_MsgList.lh_Head)->ln_Succ == NULL)
  2532. X    return(0);
  2533. X    return(1);
  2534. X}
  2535. X
  2536. END_OF_FILE
  2537. if test 1980 -ne `wc -c <'uucp2/src/uuser/misc.c'`; then
  2538.     echo shar: \"'uucp2/src/uuser/misc.c'\" unpacked with wrong size!
  2539. fi
  2540. # end of 'uucp2/src/uuser/misc.c'
  2541. fi
  2542. echo shar: End of archive 2 \(of 12\).
  2543. cp /dev/null ark2isdone
  2544. MISSING=""
  2545. for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
  2546.     if test ! -f ark${I}isdone ; then
  2547.     MISSING="${MISSING} ${I}"
  2548.     fi
  2549. done
  2550. if test "${MISSING}" = "" ; then
  2551.     echo You have unpacked all 12 archives.
  2552.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2553. else
  2554.     echo You still need to unpack the following archives:
  2555.     echo "        " ${MISSING}
  2556. fi
  2557. ##  End of shell archive.
  2558. exit 0
  2559. -- 
  2560. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  2561. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  2562. Post requests for sources, and general discussion to comp.sys.amiga.
  2563.